Skip to content

Commit

Permalink
GHA: modernize - step 4
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Jan 23, 2025
1 parent 7966b91 commit 364c1da
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/future_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ jobs:
- { plan: 'multisession' }
- { plan: 'sequential' }
- { plan: 'future.batchtools::batchtools_local' }
- { plan: 'future.batchtools::batchtools_bash' }
- { plan: 'future.callr::callr' }

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
_R_CHECK_MATRIX_DATA_: true
_R_CHECK_CRAN_INCOMING_: false
Expand All @@ -42,35 +41,28 @@ jobs:

- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- name: Query R package 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
uses: actions/cache@v4
- uses: r-lib/actions/setup-r-dependencies@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-
extra-packages: |
any::rcmdcheck
any::remotes
any::sessioninfo
any::covr
needs: check

- name: Install R package system dependencies (Linux)
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
- name: Install dependencies
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}

- name: Install R package dependencies
- name: Session info
run: |
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source") ## needed by parallel workers
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Install 'future.tests' and any backend R packages
Expand Down

0 comments on commit 364c1da

Please sign in to comment.