1- name : pre-review
1+ name : CI
22
33on :
44 merge_group :
1717 GRADLE_OPTS : " -Xmx6g -Dorg.gradle.parallel=true"
1818
1919jobs :
20+
2021 repolint :
2122 name : " Repository Linting"
2223 runs-on : ubuntu-latest
2829 ref : ${{ github.event.pull_request.head.sha || github.ref }}
2930 - name : Lint Repo
3031 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
32+
3133 gradle-wrapper :
3234 name : " Gradle Wrapper Validation"
3335 runs-on : ubuntu-latest
3638 with :
3739 ref : ${{ github.event.pull_request.head.sha || github.ref }}
3840 - uses : gradle/actions/wrapper-validation@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
41+
3942 spotless-checkLicense :
4043 name : " Spotless & Check License"
4144 runs-on : ubuntu-latest
6265 with :
6366 name : checkLicense
6467 path : build/reports/dependency-license
68+
6569 compile :
6670 runs-on : ubuntu-latest
6771 timeout-minutes : 30
8286 cache-disabled : true
8387 - name : Gradle Compile
8488 run : ./gradlew build -x test -x spotlessCheck
89+ - name : Upload tar.gz
90+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
91+ with :
92+ name : besu-tar
93+ path : build/distributions/besu-*.tar.gz
94+ retention-days : 10
95+ - name : Upload zip
96+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
97+ with :
98+ name : besu-zip
99+ path : build/distributions/besu-*.zip
100+ retention-days : 10
101+ - name : Upload workspace build
102+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
103+ with :
104+ name : assemble-output
105+ path : |
106+ ./
107+ !./.git/**
108+ retention-days : 1
109+ include-hidden-files : ' true'
110+
111+ # Supply chain security: verifies that source JARs for all dependencies are recorded
112+ # in verification-metadata.xml. Prevents tampered or undeclared source artifacts
113+ # from being introduced without explicit sign-off.
85114 verify-source-metadata :
86115 name : " Verify Dependency Source Metadata"
87116 runs-on : ubuntu-latest
@@ -102,59 +131,67 @@ jobs:
102131 cache-disabled : true
103132 - name : Verify source artifacts recorded in verification-metadata.xml
104133 run : ./gradlew verifySourceArtifacts
134+
135+ # Tests
105136 unitTests :
106- runs-on : besu-research-ubuntu-16 # more cores
107- timeout-minutes : 30
108- needs : [spotless-checkLicense, gradle-wrapper, repolint]
137+ needs : compile
138+ permissions :
139+ actions : read
140+ contents : read
141+ uses : ./.github/workflows/matrix-tests-template.yml
142+ with :
143+ assemble_output_run_id : ${{ github.run_id }}
144+ stage_name : Unit Tests
145+ stage_key : unit
146+ gradle_task : test
147+ src_pattern : " */src/test/java/*"
148+ src_root : " src/test/java"
149+ runner : besu-research-ubuntu-16
150+
151+ unittests-passed :
152+ name : unittests-passed
153+ runs-on : ubuntu-latest
154+ needs : [unitTests]
109155 permissions :
110156 checks : write
111157 statuses : write
112- strategy :
113- fail-fast : true
158+ if : always()
159+ steps :
160+ - name : Fail on workflow error
161+ run : exit 1
162+ if : >-
163+ ${{
164+ contains(needs.*.result, 'failure')
165+ || contains(needs.*.result, 'cancelled')
166+ || contains(needs.*.result, 'skipped')
167+ }}
168+
169+ integrationTests :
170+ runs-on : ubuntu-latest
171+ timeout-minutes : 30
172+ needs : compile
173+ permissions :
174+ statuses : write
175+ checks : write
114176 steps :
115177 - name : Checkout Repo
116178 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
117179 with :
118180 ref : ${{ github.event.pull_request.head.sha || github.ref }}
119- - name : Set up Java
120- uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
121- with :
122- distribution : temurin
123- java-version : 25
124- - name : Install required packages
125- run : sudo apt-get install -y xmlstarlet
126- - name : Setup Gradle
127- uses : gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
128- with :
129- cache-disabled : true
130- add-job-summary : on-failure
131- - name : run unit tests
132- env :
133- # reducing JVM forks to increase reuse of setup code such as SignatureAlgorithm
134- GRADLE_MAX_TEST_FORKS : 2 # besu-research-ubuntu-16 will use 8 by default
135- run : ./gradlew -Dorg.gradle.parallel=true -Dorg.gradle.caching=true test
136- - name : Upload Unit Test Results
137- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
138- with :
139- name : unit-test-results
140- path : ' **/test-results/**/TEST-*.xml'
141- - name : Upload Unit Test HTML Reports
142- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
143- if : success() || failure()
144- with :
145- name : unit-test-html-reports
146- path : ' **/build/reports/tests/test/**'
147- unittests-passed :
148- name : " unittests-passed"
181+ - name : Setup Java and Gradle
182+ uses : consensys/github-actions/java-setup-gradle@727fd33127a4dc399532450bf9a62f2cfe9fa949
183+ - name : Run integration tests and compile JMH benchmarks
184+ run : ./gradlew integrationTest compileJmh
185+
186+ integration-passed :
187+ name : integration-passed
149188 runs-on : ubuntu-latest
150- needs : [compile, unitTests, verify-source-metadata ]
189+ needs : [integrationTests ]
151190 permissions :
152191 checks : write
153192 statuses : write
154193 if : always()
155194 steps :
156- # Fail if any `needs` job was not a success.
157- # Along with `if: always()`, this allows this job to act as a single required status check for the entire workflow.
158195 - name : Fail on workflow error
159196 run : exit 1
160197 if : >-
@@ -163,17 +200,3 @@ jobs:
163200 || contains(needs.*.result, 'cancelled')
164201 || contains(needs.*.result, 'skipped')
165202 }}
166- - name : Checkout Repo
167- if : always()
168- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
169- with :
170- ref : ${{ github.event.pull_request.head.sha || github.ref }}
171- - name : Download all unit test results
172- if : always()
173- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
174- with :
175- pattern : unit-test-results
176- merge-multiple : true
177- - name : Report 10 slowest tests
178- if : always()
179- run : python3 .github/workflows/reportSlowestTests.sh 10
0 commit comments