From aecf2c146fe57b8e09d76b7abb151f279fc8b916 Mon Sep 17 00:00:00 2001 From: Les Hazlewood <121180+lhazlewood@users.noreply.github.com> Date: Sat, 30 Apr 2022 16:54:05 -0400 Subject: [PATCH] Separate code coverage build from standard JDK builds (#739) Resolves #738 --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36be98e0..420f5342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,14 +28,6 @@ jobs: # run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg # to sign artifacts, since we don't want to mess with storing signing credentials in CI: run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true - - name: Code coverage - if: matrix.java == '8' - run: | - ${{env.MVN_CMD}} clean clover:setup test - ${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report \ - -DrepoToken="${{ secrets.GITHUB_TOKEN }}" \ - -DserviceName=github \ - -DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}" zulu: strategy: @@ -89,3 +81,39 @@ jobs: # run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg # to sign artifacts, since we don't want to mess with storing signing credentials in CI: run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true + + code-coverage: + # (commented out for now - see the comments in 'Wait to start' below for why. Keeping this here as a placeholder + # as it may be better to use instead of an artificial delay once we no longer need to build on JDK 7): + #needs: zulu # wait until others finish so a coverage failure doesn't cancel others accidentally + runs-on: 'ubuntu-latest' + env: + MVN_CMD: ./mvnw --no-transfer-progress -B + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8' + cache: 'maven' + check-latest: true + - name: Wait to start + # wait a little to start: code coverage usually only takes about 1 1/2 minutes. If coverage fails, it will + # cancel the other running builds, and we don't want that (because we want to see if jobs fail due to + # build issues, not due to the code-coverage job causing the others to cancel). We could have used the + # 'need' property (commented out above), and that would wait until all the other jobs have finished before + # starting this one, but that introduces unnecessary (sometimes 2 1/2 minute) delay, whereas delaying the + # start of the code coverage checks a bit should allow everything to finish around the same time without having + # much of an adverse effect on the other jobs above. + run: sleep 90s + shell: bash + - name: Code Coverage + # run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg + # to sign artifacts, since we don't want to mess with storing signing credentials in CI: + run: | + ${{env.MVN_CMD}} clover:setup test && \ + ${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report \ + -DrepoToken="${{ secrets.GITHUB_TOKEN }}" \ + -DserviceName=github \ + -DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}"