Skip to content

Commit 7b9cf56

Browse files
authored
Simplify CI steps (#627)
- Remove manual archive/unarchive now upload-artifact@v4 supports doing this implicitly without taking an extremely long time to do so. - Remove concurrency limit as GitHub throttles this anyway. - Remove manual codecov upload and use the action instead. - Upload codecov directly from each runner rather than aggregating.
2 parents 3fbb3ad + a2d2391 commit 7b9cf56

File tree

1 file changed

+15
-51
lines changed

1 file changed

+15
-51
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161

6262
strategy:
6363
fail-fast: false
64-
max-parallel: 10
6564
matrix:
6665
os-name: [ubuntu-latest]
6766
java-version:
@@ -144,6 +143,11 @@ jobs:
144143
shell: bash
145144
run: ./mvnw -B -U -Dcheckstyle.skip=true -Dlicense.skip=true clean verify
146145

146+
- name: Upload to codecov
147+
uses: codecov/codecov-action@v3
148+
with:
149+
name: tests-java-${{ matrix.java-version }}-os-${{ matrix.os-name }}
150+
147151
- name: Annotate test reports with build environment info
148152
if: always()
149153
shell: bash
@@ -152,34 +156,19 @@ jobs:
152156
-j "${{ matrix.java-version }}"
153157
-o "${{ matrix.os-name }}"
154158
155-
# Compress first so that the collection job later takes far less time (order of a few minutes
156-
# or so). GitHub does not compress these until after the workflow finishes, meaning when
157-
# we unstash them to produce the coverage reports, it will make an HTTP call for every single
158-
# file. This can take several minutes and is somewhat painful to have to wait for.
159-
- name: Compress test and coverage reports into tarball
160-
if: always()
161-
shell: bash
162-
run: |-
163-
set -x
164-
# Allow globs to not match anything without causing errors.
165-
shopt -s nullglob
166-
167-
# XZ with max compression, more efficient than using GZip.
168-
XZ_OPT=-9 tar -Jcvf reports-${{ matrix.java-version }}-${{ matrix.os-name }}.tar.xz \
169-
$(find . -name surefire-reports -o -name failsafe-reports) \
170-
$(find . -name 'jacoco.xml')
171-
172-
- name: Stash reports tarball
159+
- name: Stash reports
173160
uses: actions/upload-artifact@v4
174161
if: always()
175162
with:
176163
name: reports-${{ matrix.java-version }}-${{ matrix.os-name }}
177164
if-no-files-found: error
178-
path: reports-${{ matrix.java-version }}-${{ matrix.os-name }}.tar.xz
165+
path: |
166+
**/surefire-reports/**
167+
**/failsafe-reports/**
179168
retention-days: 30
180169

181-
publish-test-reports:
182-
name: Publish test reports
170+
aggregate-test-reports:
171+
name: Aggregate test results
183172
runs-on: ubuntu-latest
184173
if: always()
185174
needs:
@@ -197,16 +186,12 @@ jobs:
197186
# Needed to keep actions working correctly.
198187
fetch-depth: 2
199188

200-
- name: Download stashed tarballs
189+
- name: Download reports
201190
uses: actions/download-artifact@v4
202191
with:
203-
path: 'artifacts/reports-*.tar.xz'
204-
205-
- name: Decompress stashed report tarballs
206-
shell: bash
207-
run: |-
208-
find artifacts/ -name "reports-*.tar.xz" -exec tar -Jxvf {} \;
209-
find artifacts/ -name "reports-*.tar.xz" -exec rm -v {} \;
192+
path: |
193+
**/surefire-reports/**
194+
**/failsafe-reports/**
210195
211196
- name: Publish test results
212197
continue-on-error: true
@@ -223,21 +208,6 @@ jobs:
223208
test_changes_limit: 500
224209
time_unit: "milliseconds"
225210

226-
- name: Publish to codecov
227-
continue-on-error: true
228-
if: always()
229-
shell: bash
230-
run: |-
231-
curl --fail https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring \
232-
--keyring trustedkeys.gpg --import
233-
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov
234-
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
235-
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
236-
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
237-
shasum -a 256 -c codecov.SHA256SUM
238-
chmod -v +x codecov
239-
./codecov -v
240-
241211
generate-documentation:
242212
name: Generate documentation
243213
runs-on: ubuntu-latest
@@ -294,9 +264,3 @@ jobs:
294264
- name: Deploy JavaDocs build artifact to GitHub Pages
295265
id: snapshot-javadocs
296266
uses: actions/deploy-pages@v4
297-
298-
- name: Delete temporary artifacts
299-
uses: geekyeggo/delete-artifact@v4
300-
with:
301-
name: github-pages
302-
failOnError: false

0 commit comments

Comments
 (0)