CI check to make sure that all libraries have their source code verified #13348
Workflow file for this run
This file contains hidden or 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
| name: pre-review | |
| on: | |
| merge_group: | |
| pull_request: | |
| branches: | |
| - main | |
| - release-* | |
| - verkle | |
| - performance | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true" | |
| jobs: | |
| repolint: | |
| name: "Repository Linting" | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/todogroup/repolinter:v0.11.2 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Lint Repo | |
| run: bundle exec /app/bin/repolinter.js --rulesetUrl https://raw.githubusercontent.com/hyperledger-labs/hyperledger-community-management-tools/main/repo_structure/repolint.json --format markdown | |
| gradle-wrapper: | |
| name: "Gradle Wrapper Validation" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - uses: gradle/actions/wrapper-validation@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 | |
| spotless-checkLicense: | |
| name: "Spotless & Check License" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Set up Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 | |
| with: | |
| cache-disabled: true | |
| - name: run spotless | |
| run: ./gradlew spotlessCheck | |
| - name: run checkLicense | |
| run: ./gradlew --no-parallel checkLicense # no-parallel due to https://github.com/jk1/Gradle-License-Report/issues/337 | |
| - name: upload license report | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: checkLicense | |
| path: build/reports/dependency-license | |
| compile: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: [spotless-checkLicense, gradle-wrapper, repolint] | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Set up Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 | |
| with: | |
| cache-disabled: true | |
| - name: Gradle Compile | |
| run: ./gradlew build -x test -x spotlessCheck | |
| verify-source-metadata: | |
| name: "Verify Dependency Source Metadata" | |
| runs-on: ubuntu-latest | |
| needs: [spotless-checkLicense, gradle-wrapper, repolint] | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Set up Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 | |
| with: | |
| cache-disabled: true | |
| - name: Verify source artifacts recorded in verification-metadata.xml | |
| run: ./gradlew verifySourceArtifacts | |
| unitTests: | |
| runs-on: besu-research-ubuntu-16 # more cores | |
| needs: [spotless-checkLicense, gradle-wrapper, repolint] | |
| permissions: | |
| checks: write | |
| statuses: write | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Set up Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Install required packages | |
| run: sudo apt-get install -y xmlstarlet | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 | |
| with: | |
| cache-disabled: true | |
| add-job-summary: on-failure | |
| - name: run unit tests | |
| env: | |
| # reducing JVM forks to increase reuse of setup code such as SignatureAlgorithm | |
| GRADLE_MAX_TEST_FORKS: 2 # besu-research-ubuntu-16 will use 8 by default | |
| run: ./gradlew -Dorg.gradle.parallel=true -Dorg.gradle.caching=true test | |
| - name: Upload Unit Test Results | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: unit-test-results | |
| path: '**/test-results/**/TEST-*.xml' | |
| - name: Upload Unit Test HTML Reports | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| if: success() || failure() | |
| with: | |
| name: unit-test-html-reports | |
| path: '**/build/reports/tests/test/**' | |
| unittests-passed: | |
| name: "unittests-passed" | |
| runs-on: ubuntu-latest | |
| needs: [compile, unitTests, verify-source-metadata] | |
| permissions: | |
| checks: write | |
| statuses: write | |
| if: always() | |
| steps: | |
| # Fail if any `needs` job was not a success. | |
| # Along with `if: always()`, this allows this job to act as a single required status check for the entire workflow. | |
| - name: Fail on workflow error | |
| run: exit 1 | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| }} | |
| - name: Checkout Repo | |
| if: always() | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Download all unit test results | |
| if: always() | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: unit-test-results | |
| merge-multiple: true | |
| - name: Report 10 slowest tests | |
| if: always() | |
| run: python3 .github/workflows/reportSlowestTests.sh 10 |