Trim modules (#17) #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
assemble: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
container: | |
image: tmio/tuweni-build:1.2 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up GPG key | |
run: gpg --import gradle/tuweni-test.asc | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: gradle | |
- name: gradle assemble | |
run: gradle assemble compileTestJava compileIntegrationTestJava -x test -Psignatory.keyId=90010D4396A46BAF -Psigning.gnupg.keyName=90010D4396A46BAF -Psigning.gnupg.executable=gpg | |
env: | |
ENABLE_SIGNING: true | |
- name: Upload source distrib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: distsrc | |
path: dist/build/distributions/tuweni-src-*.zip | |
- name: Upload binary distrib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snapshot.zip | |
path: dist/build/distributions/tuweni-bin-*.zip | |
- name: Cache classes | |
uses: actions/cache@v3 | |
with: | |
path: "**/*.class" | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
test: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
needs: assemble | |
container: | |
image: tmio/tuweni-build:1.2 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: gradle | |
- name: Cache classes | |
uses: actions/cache@v3 | |
with: | |
path: "**/*.class" | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
- name: gradle test | |
run: gradle test | |
- name: Archive Junit Report | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: junit-report | |
path: '**/build/reports/tests/**' | |
retention-days: 5 | |
check-src: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
needs: assemble | |
steps: | |
- name: Download distsrc | |
uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: distsrc | |
- name: Unzip source | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: unzip -q -o - tuweni-src-*.zip -d distunzipped | |
- name: Unzip source | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: Expand-Archive -Force -Path tuweni-src-*.zip -DestinationPath distunzipped | |
- name: Rename folder | |
run: mv distunzipped/tuweni-src-* distunzipped/tuweni | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: gradle | |
- name: Build from source | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: cd distunzipped/tuweni && ./gradlew assemble | |
- name: Build from source | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: cd distunzipped/tuweni && ./gradlew.bat assemble | |
integration-tests: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
needs: assemble | |
container: | |
image: tmio/tuweni-build:1.2 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: gradle | |
- name: Cache classes | |
uses: actions/cache@v3 | |
with: | |
path: "**/*.class" | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
- name: gradle integrationTest | |
run: gradle compileJava compileKotlin compileIntegrationTestJava compileIntegrationTestKotlin devp2p:integrationTest dist:integrationTest | |
- name: Archive Junit Report | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: junit-report | |
path: '**/build/reports/tests/**' | |
retention-days: 5 | |
referenceTests: | |
timeout-minutes: 30 | |
needs: assemble | |
runs-on: ubuntu-latest | |
container: | |
image: tmio/tuweni-build:1.2 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: gradle | |
- name: Cache classes | |
uses: actions/cache@v3 | |
with: | |
path: "**/*.class" | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
- name: Archive Junit Report | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: junit-report | |
path: '**/build/reports/tests/**' | |
retention-days: 5 |