Skip to content

Commit

Permalink
reconfigrued test cov gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
16EAGLE committed Apr 17, 2024
1 parent 35f5676 commit 7232e80
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,37 @@ name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r@v2

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v1
- name: Restore R package cache
uses: actions/cache@v2
with:
extra-packages: covr
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}"")
Expand Down

0 comments on commit 7232e80

Please sign in to comment.