From 18de0b40a0d2fa4bdbd5a017ecbc4e5cac883882 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 2 Nov 2024 11:10:17 +0800 Subject: [PATCH] Add CI --- .woodpecker/R-CMD-check.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .woodpecker/R-CMD-check.yaml diff --git a/.woodpecker/R-CMD-check.yaml b/.woodpecker/R-CMD-check.yaml new file mode 100644 index 0000000..e165206 --- /dev/null +++ b/.woodpecker/R-CMD-check.yaml @@ -0,0 +1,21 @@ +# Runs R CMD check for an R package while installing dependencies with pak. +# https://github.com/r-lib/pak is used to install package dependencies. +# The first command installs pak following the install instruction of package itself. +# +# When setting Ncpus (default=1) to a higher value, pak will download and install package in parallel. +# pak automatically uses binary packages from the public Posit Package Manager. +# +# This example uses the rocker/r-base image to run the R CMD check. Any other image with R installed can be used. +# Alternatively, the rcmdcheck package can be installed and use in replacement to `R CMD check``. + +steps: + 'Check package': + when: + event: [push, pull_request] +image: rocker/r-base +secrets: [github_pat] +commands: + - R -q -s -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' +- R -q -e 'options(Ncpus = 4)' +- R -q -e 'pak::pak()' +- R CMD check --as-cran .