ci(coverage): publish Kotlin coverage report in PR comments #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| android: | |
| name: Android | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Lint & Test | |
| run: ./gradlew :app:check | |
| - name: Generate Kotlin coverage XML | |
| run: ./gradlew :app:koverXmlReport | |
| - name: Comment coverage on PR | |
| if: github.event_name == 'pull_request' | |
| uses: madrapps/jacoco-report@v1.7.1 | |
| with: | |
| paths: ${{ github.workspace }}/app/build/reports/kover/report.xml | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: Kotlin Coverage | |
| update-comment: true | |
| bridge: | |
| name: Bridge | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: bridge | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: bridge/pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint, Typecheck & Test | |
| run: pnpm check |