diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-20 16:51:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-20 16:51:05 +0100 |
| commit | 0862f8489b1122671cefa5c5bd59f677b56a3712 (patch) | |
| tree | 9256a835306601fa522476d02be4c38e0bf001c9 /.github/workflows | |
| parent | 592d60d6d2ef51923eebd844888930b07892da39 (diff) | |
| parent | fce499eaafa0afecee5c14346ff7d75e2fe999b6 (diff) | |
Add support for code coverage tracking via Codecov
This pull request enables aggregate code coverage reports via Jacoco and adds support for coverage tracking via Codecov.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build-api.yml | 23 | ||||
| -rw-r--r-- | .github/workflows/build-frontend.yml | 3 | ||||
| -rw-r--r-- | .github/workflows/build-simulator.yml | 29 |
3 files changed, 41 insertions, 14 deletions
diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml index 5bbc30c4..4ae261db 100644 --- a/.github/workflows/build-api.yml +++ b/.github/workflows/build-api.yml @@ -1,9 +1,6 @@ name: Build API on: - push: - paths: - - 'api/**' pull_request: branches: [master] @@ -29,8 +26,20 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - name: Lint with pylint - run: | - ./check.sh + run: ./check.sh - name: Test with pytest - run: | - pytest opendc + run: pytest --cov=opendc/ --junitxml=.junit-report.xml + - name: Publish report + if: always() + uses: mikepenz/action-junit-report@v2 + with: + check_name: test (Python ${{ matrix.python }}) + report_paths: '**/.junit-report.xml' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload code coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./api/.coverage + flags: api + diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index 73ab49d5..7c1b95a7 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -1,9 +1,6 @@ name: Build Frontend on: - push: - paths: - - 'frontend/**' pull_request: branches: [master] diff --git a/.github/workflows/build-simulator.yml b/.github/workflows/build-simulator.yml index 57e8b46d..1bee19bc 100644 --- a/.github/workflows/build-simulator.yml +++ b/.github/workflows/build-simulator.yml @@ -1,9 +1,6 @@ name: Build Simulator on: - push: - paths: - - 'simulator/**' pull_request: branches: [master] @@ -21,6 +18,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 - name: Set up JDK uses: actions/setup-java@v1 with: @@ -36,4 +35,26 @@ jobs: - name: Build with Gradle run: ./gradlew assemble - name: Check with Gradle - run: ./gradlew check --info + run: ./gradlew check codeCoverageReport + - name: Publish report + if: always() + uses: mikepenz/action-junit-report@v2 + with: + check_name: test (Java ${{ matrix.java }}) + report_paths: '**/build/test-results/test/TEST-*.xml' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v2 + with: + name: reports-${{ matrix.os }}-jdk${{ matrix.java }} + path: | + ./**/build/reports/**/* + ./**/build/test-results/**/* + retention-days: 5 + - name: Upload code coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./simulator/build/reports/jacoco/report.xml + flags: simulator |
