Skip to content

Commit

Permalink
Ported more features to GH Action
Browse files Browse the repository at this point in the history
- Made the coverage report work for every job (based on the discussion with @TimvdLippe). Codecov merges all reports from a single CI invocation, giving us a more accurate coverage value.
- Added spotless invocation as a part of a single job (there is no point running spotless step for every job in the matrix - it will have the same results each time)

[skip travis]
  • Loading branch information
mockitoguy authored and holubec-petr committed Nov 20, 2020
1 parent cf602d4 commit 64b703f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: "Verify code formatting with Spotless. Run './gradlew spotlessApply' locally if this job fails."
#We want to run spotless check only in a single job
if: matrix.java == 11 && matrix.mock-maker == 'mock-maker-default'
run: ./gradlew spotlessCheck
- name: Build on Java ${{ matrix.java }} with ${{ matrix.mock-maker }}
run: ./gradlew build -m --scan # TODO: remove -m
env:
MOCK_MAKER: ${{ matrix.mock-maker }}
- name: Upload coverage report
if: matrix.java == 8 && matrix.mock-maker == 'mock-maker-default'
run: |
./gradlew coverageReport -s --scan && cp build/reports/jacoco/mockitoCoverage/mockitoCoverage.xml jacoco.xml || echo "Code coverage failed"
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
Expand Down

0 comments on commit 64b703f

Please sign in to comment.