Skip to content

Commit

Permalink
update GHA workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Jan 12, 2023
1 parent 94c01d8 commit 381d984
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@master
with:
Expand Down
34 changes: 7 additions & 27 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,24 @@ name: test-coverage

jobs:
test-coverage:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
runs-on: macOS-latest

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

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

- 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: Install additional dependencies
run: |
remotes::install_github('PredictiveEcology/Require@development')
remotes::install_github('PredictiveEcology/reproducible@development')
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
- uses: r-lib/actions/setup-r-dependencies@v2
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 dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
extra-packages: |
any::covr
- name: Test coverage
run: covr::codecov()
Expand Down

0 comments on commit 381d984

Please sign in to comment.