Skip to content

Commit

Permalink
Migrate to new-style actions
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 7, 2021
1 parent 9ffaa13 commit ba32630
Showing 1 changed file with 35 additions and 66 deletions.
101 changes: 35 additions & 66 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches:
Expand All @@ -22,9 +22,9 @@ name: rcc

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

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

# Begin custom: services
# End custom: services
Expand All @@ -36,34 +36,41 @@ jobs:
max-parallel: 5
matrix:
config:
- { os: macOS-latest, r: 'release' }
- { os: windows-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/all/latest" }
- { os: windows-latest, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/all/latest" }
- { os: ubuntu-, os-version: 20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: ubuntu-, os-version: 18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest" }
- { os: ubuntu-, os-version: 18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- { os: ubuntu-, os-version: 18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest" }
- {os: macOS-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}

- {os: ubuntu-20.04, r: 'release'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}

# Begin custom: R 3.6
- {os: ubuntu-, os-version: 18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel-2'}
# End custom: R 3.6

# Begin custom: R 3.5
- {os: ubuntu-, os-version: 18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel-3'}
# End custom: R 3.5

# Begin custom: R 3.4
- {os: ubuntu-, os-version: 18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel-4'}
# End custom: R 3.4

# Begin custom: matrix elements
# End custom: matrix elements
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
_R_CHECK_SYSTEM_CLOCK_: false
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false
# Begin custom: env vars
# End custom: env vars

Expand All @@ -78,55 +85,24 @@ jobs:
# Begin custom: before install
# End custom: before install

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

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

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

- name: Install remotes
run: |
if (!requireNamespace("curl", quietly = TRUE)) install.packages("curl")
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
shell: Rscript {0}

- name: Query dependencies
if: runner.os != 'Windows'
run: |
saveRDS(remotes::dev_package_deps(dependencies = TRUE, type = .Platform$pkgType), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}${{ matrix.config.os-version }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}${{ matrix.config.os-version }}-${{ hashFiles('.github/R-version') }}-2-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "${{matrix.config.os-version}}"))')
extra-packages: rcmdcheck

- name: Add fake qpdf and checkbashisms
if: runner.os == 'Linux'
run: |
sudo ln -s $(which true) /usr/local/bin/qpdf
sudo ln -s $(which true) /usr/local/bin/checkbashisms
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
Expand All @@ -138,18 +114,11 @@ jobs:
# Begin custom: after install
# End custom: after install

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false
run: |
options(crayon.enabled = TRUE)
error_on <- "note"
# Begin custom: rcmdcheck error_on
# End custom: rcmdcheck error_on
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = error_on, check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v1
with:
# Begin custom: rcmdcheck error_on
- error_on: '"note"'
# End custom: rcmdcheck error_on

- name: Show test output
if: always()
Expand Down

0 comments on commit ba32630

Please sign in to comment.