From 381d98490fe6b91b69568392ee5825c4d0fae110 Mon Sep 17 00:00:00 2001 From: Alex Chubaty Date: Thu, 12 Jan 2023 14:43:22 -0700 Subject: [PATCH] update GHA workflows --- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/test-coverage.yaml | 34 ++++++---------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 04c3c54..475bade 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -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: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index cb0d68b..baf5a6e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -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()