Skip to content

Commit

Permalink
Update coverage actions
Browse files Browse the repository at this point in the history
Use Ubuntu 2022. Use action to install dependencies
  • Loading branch information
arnfinn committed Jan 16, 2024
1 parent 4114238 commit 14271b8
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
GITHUB_PAT: ${{ secrets.GH_TOKEN }}
GITHUB_ACTIONS_RUN_DB_UNIT_TESTS: true
Expand Down Expand Up @@ -40,33 +40,18 @@ jobs:
run: |
sudo /etc/init.d/mysql start
- 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}

- name: Cache R packages
uses: actions/cache@v3
with:
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 system dependencies
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))')
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
Expand Down

0 comments on commit 14271b8

Please sign in to comment.