Skip to content

Commit

Permalink
update action RMD
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejohnson51 committed May 14, 2024
1 parent 9ec83b1 commit 0a6ac9a
Showing 1 changed file with 31 additions and 51 deletions.
82 changes: 31 additions & 51 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,53 @@
on:
push:
branches:
- main
branches: [main, master]
pull_request:
branches:
- main
branches: [main, master]

name: R-CMD-check
name: R CMD Check

jobs:
R-CMD-check:
runs-on: ubuntu-20.04
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_TESTS_NLINES_: 0
NOT_CRAN: true
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@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}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@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-
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- name: Check
run: rcmdcheck::rcmdcheck(args = c("--ignore-vignettes", "--no-manual"), build_args = c("--no-build-vignettes"), error_on = "error", check_dir = "check")
run: rcmdcheck::rcmdcheck(args = c("--ignore-vignettes", "--no-manual", "--no-tests"),
build_args = c("--no-build-vignettes"),
error_on = "error",
check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: results
path: check

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
#
# - name: debug
# if: failure()
# uses: mxschmitt/action-tmate@v3
path: check

0 comments on commit 0a6ac9a

Please sign in to comment.