Skip to content

Commit

Permalink
Try r-lib actions to resolve install/cache issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Apr 29, 2024
1 parent d887070 commit b5d5ff1
Showing 1 changed file with 7 additions and 38 deletions.
45 changes: 7 additions & 38 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-13, r: 'devel', rtools: ''}
- {os: macOS-13, r: 'release', rtools: ''}
- {os: macOS-latest, r: 'devel', rtools: ''}
- {os: macOS-latest, r: 'release', rtools: ''}
- {os: windows-latest, r: 'devel', rtools: '44'}
- {os: windows-latest, r: 'release', rtools: '44'}
- {os: windows-latest, r: 'oldrel', rtools: '43'}
- {os: ubuntu-20.04, r: 'devel', rtools: ''}
- {os: ubuntu-20.04, r: 'release', rtools: ''}
- {os: ubuntu-20.04, r: 'oldrel', rtools: ''}
- {os: ubuntu-latest, r: 'devel', rtools: ''}
- {os: ubuntu-latest, r: 'release', rtools: ''}
- {os: ubuntu-latest, r: 'oldrel', rtools: ''}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -49,42 +49,13 @@ jobs:

- uses: actions/checkout@v4

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev || true
sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev || true
- uses: r-lib/actions/[email protected]
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
- uses: r-lib/actions/[email protected]

- 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@v4
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: |
Sys.setenv("MAKEFLAGS"="-j2")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_local(path = ".")
install.packages("curl")
shell: Rscript {0}
- uses: r-lib/actions/[email protected]

- name: Install cmdstan
run: |
Expand All @@ -99,11 +70,9 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
- uses: r-lib/actions/[email protected]
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

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

0 comments on commit b5d5ff1

Please sign in to comment.