Skip to content

Commit aecf2c1

Browse files
authored
Separate code coverage build from standard JDK builds (#739)
Resolves #738
1 parent 19db6e1 commit aecf2c1

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ jobs:
2828
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
2929
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
3030
run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true
31-
- name: Code coverage
32-
if: matrix.java == '8'
33-
run: |
34-
${{env.MVN_CMD}} clean clover:setup test
35-
${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report \
36-
-DrepoToken="${{ secrets.GITHUB_TOKEN }}" \
37-
-DserviceName=github \
38-
-DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}"
3931

4032
zulu:
4133
strategy:
@@ -89,3 +81,39 @@ jobs:
8981
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
9082
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
9183
run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true
84+
85+
code-coverage:
86+
# (commented out for now - see the comments in 'Wait to start' below for why. Keeping this here as a placeholder
87+
# as it may be better to use instead of an artificial delay once we no longer need to build on JDK 7):
88+
#needs: zulu # wait until others finish so a coverage failure doesn't cancel others accidentally
89+
runs-on: 'ubuntu-latest'
90+
env:
91+
MVN_CMD: ./mvnw --no-transfer-progress -B
92+
steps:
93+
- uses: actions/checkout@v3
94+
- name: Set up JDK
95+
uses: actions/setup-java@v3
96+
with:
97+
distribution: 'zulu'
98+
java-version: '8'
99+
cache: 'maven'
100+
check-latest: true
101+
- name: Wait to start
102+
# wait a little to start: code coverage usually only takes about 1 1/2 minutes. If coverage fails, it will
103+
# cancel the other running builds, and we don't want that (because we want to see if jobs fail due to
104+
# build issues, not due to the code-coverage job causing the others to cancel). We could have used the
105+
# 'need' property (commented out above), and that would wait until all the other jobs have finished before
106+
# starting this one, but that introduces unnecessary (sometimes 2 1/2 minute) delay, whereas delaying the
107+
# start of the code coverage checks a bit should allow everything to finish around the same time without having
108+
# much of an adverse effect on the other jobs above.
109+
run: sleep 90s
110+
shell: bash
111+
- name: Code Coverage
112+
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
113+
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
114+
run: |
115+
${{env.MVN_CMD}} clover:setup test && \
116+
${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report \
117+
-DrepoToken="${{ secrets.GITHUB_TOKEN }}" \
118+
-DserviceName=github \
119+
-DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}"

0 commit comments

Comments
 (0)