From 7ae3713bed67efb75edb05a0cefb3518ee0f9698 Mon Sep 17 00:00:00 2001 From: katieb1 Date: Sun, 13 Oct 2024 16:36:22 -0700 Subject: [PATCH] Add R-CMD-check to github workflows --- .github/workflows/R-CMD-check.yml | 91 +++++++++++++++++++++++++++++++ .gitignore | 2 +- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/R-CMD-check.yml diff --git a/.github/workflows/R-CMD-check.yml b/.github/workflows/R-CMD-check.yml new file mode 100644 index 00000000..92cfcb1a --- /dev/null +++ b/.github/workflows/R-CMD-check.yml @@ -0,0 +1,91 @@ +on: [push, pull_request] + +name: R-CMD-check + +jobs: + R-CMD-check: + + # From r-lib/actions + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: windows-latest, r: 'devel'} + # - {os: macOS-latest, r: 'release'} + # - {os: macOS-latest, r: 'devel'} + - {os: ubuntu-latest, r: 'release'} # r-lib/actions not supported # r-lib/actions not supported (setup-r OS) + - {os: ubuntu-latest, r: 'devel'} # r-lib/actions not supported # r-lib/actions not supported (setup-r OS) + # - {os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + # - {os: ubuntu-16.04, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} # r-lib/actions not supported (setup-r R version) + # - {os: ubuntu-18.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"} + #- {os: ubuntu-18.04, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"} # r-lib/actions not supported (setup-r R versin) + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + _R_CHECK_DONTTEST_EXAMPLES_: false + RSPM: ${{ matrix.config.rspm }} + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-tinytex@v2 + if: runner.os != 'Windows' + + - name: Install GDAL + qpdf / Linux + if: runner.os == 'Linux' + run: | + sudo apt-get install libgdal-dev + sudo apt-get install qpdf + + - name: Install GDAL + qpdf / Mac OS + if: runner.os == 'macOS' + run: | + brew install gdal + brew install qpdf + + # From r-lib/actions + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v3 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }} + restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- + + - name: Install dependencies + run: | + install.packages(c("remotes", "rcmdcheck")) + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + + - name: Check + env: + NOT_CRAN: true + continue-on-error: true + run: | + install.packages("https://cran.r-project.org/src/contrib/Archive/curl/curl_4.3.2.tar.gz", repos=NULL, type="source") + rcmdcheck::rcmdcheck(build_args = c("--no-manual", "--no-build-vignettes"), args = c("--no-manual", "--ignore-vignettes"), error_on = "error") + shell: Rscript {0} + + - name: Check as CRAN + env: + NOT_CRAN: false + run: | + install.packages("https://cran.r-project.org/src/contrib/Archive/curl/curl_4.3.2.tar.gz", repos=NULL, type="source") + rcmdcheck::rcmdcheck(build_args = c("--no-manual", "--no-build-vignettes"), args = c("--no-manual", "--ignore-vignettes", "--as-cran"), error_on = "error") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.gitignore b/.gitignore index 3a90ca95..2481baca 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,5 @@ rsyncrosim.Rcheck debugging.R binaries/ # Don't build R-CMD-check (broken) -**/R-CMD-check.yml +#**/R-CMD-check.yml # tests_in_progress/