Skip to content

Commit

Permalink
GHA: Attempt to coverage job
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Oct 27, 2024
1 parent b4c95da commit f6c7d40
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
on: [push]

name: covr
name: test-coverage.yaml

permissions: read-all

jobs:
covr:
if: "! contains(github.event.head_commit.message, '[ci skip]')"

timeout-minutes: 20

test-coverage:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- name: Assert CODECOV_TOKEN is set
run: |
if [[ -z "${{secrets.CODECOV_TOKEN}}" ]]; then
>&2 echo "::error::ERROR: 'secrets.CODECOV_TOKEN' not set"
exit 1
fi
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
Expand All @@ -29,18 +29,14 @@ jobs:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Install dependencies
run: |
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

Expand All @@ -52,13 +48,6 @@ jobs:
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit f6c7d40

Please sign in to comment.