blob: 44fa77267355321dad6f3d732cb0e75d17989e1b [file] [log] [blame]
Marc Kupietz1087dcf2025-06-05 14:40:52 +02001# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
Marc Kupietz1ae886b2021-12-21 19:04:05 +01003on:
4 push:
5 branches: [main, master]
Marc Kupietz39af4a62023-04-19 20:21:16 +02006 paths-ignore:
7 - '**.md'
Marc Kupietz1ae886b2021-12-21 19:04:05 +01008 pull_request:
9 branches: [main, master]
Marc Kupietz39af4a62023-04-19 20:21:16 +020010 paths-ignore:
11 - '**.md'
Marc Kupietz1ae886b2021-12-21 19:04:05 +010012
13name: test-coverage
14
15jobs:
16 test-coverage:
17 runs-on: ubuntu-latest
Marc Kupietz1087dcf2025-06-05 14:40:52 +020018 env:
19 GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Marc Kupietz1ae886b2021-12-21 19:04:05 +010021
22 steps:
Marc Kupietz1087dcf2025-06-05 14:40:52 +020023 - uses: actions/checkout@v3
24
25 - uses: r-lib/actions/setup-r@v2
26 with:
27 use-public-rspm: true
28
29 - uses: r-lib/actions/setup-r-dependencies@v2
30 with:
31 extra-packages: any::covr, any::XML
32 needs: coverage
33
34 - name: Test coverage
35 run: |
36 cov <- covr::package_coverage(
37 quiet = FALSE,
38 clean = FALSE,
39 install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
40 )
41 covr::to_cobertura(cov)
42 shell: Rscript {0}
43
44 - uses: codecov/codecov-action@v4
Marc Kupietz1ae886b2021-12-21 19:04:05 +010045 with:
Marc Kupietz020f4db2025-06-05 14:36:26 +020046 fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
Marc Kupietz1087dcf2025-06-05 14:40:52 +020047 file: ./cobertura.xml
48 plugin: noop
49 disable_search: true
Marc Kupietz020f4db2025-06-05 14:36:26 +020050 token: ${{ secrets.CODECOV_TOKEN }}