Skip to content

Commit

Permalink
Add job with coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
nowakweronika committed Jan 19, 2024
1 parent 47679f0 commit 1fc262b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: ./.github/actions/prepare-android-env

- name: Run test
run: ./gradlew codeCoverage
run: ./gradlew test
env:
LOUDIUS_CLIENT_SECRET: ${{ secrets.LOUDIUS_CLIENT_SECRET }}
LOUDIUS_CLIENT_ID: ${{ secrets.LOUDIUS_CLIENT_ID }}
Expand Down Expand Up @@ -163,6 +163,39 @@ jobs:
*/build/test-results/**
retention-days: 5

code-coverage:
name: Measure coverage
runs-on: ubuntu-20.04
permissions:
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Run Coverage
run: |
chmod +x gradlew
./gradlew codeCoverage
- name: Store HTML coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: |
*/build/reports/jacoco/codeCoverage/html/**
- name: Add coverage to PR
if: ${{ github.event_name != 'schedule' }}
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
*/build/reports/jacoco/codeCoverage/*.xml
token: ${{ secrets.GITHUB_TOKEN }}

test-license-headers:
name: Ensure license headers are added
runs-on: ubuntu-20.04
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ android {
}

tasks.register('codeCoverage', JacocoReport) {
dependsOn 'testDebugUnitTest'

reports {
html.required.set(true)
Expand Down Expand Up @@ -141,7 +140,9 @@ tasks.register('codeCoverage', JacocoReport) {
dir: project.buildDir,
includes: [
"**/*.exec",
"**/*.ec"
"**/*.ec",
"**/**/*.exec",
"**/**/*.ec"
]))

}
Expand Down

0 comments on commit 1fc262b

Please sign in to comment.