Skip to content

Commit

Permalink
Update r_ubuntu.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
davidycliao committed Sep 20, 2024
1 parent db6f829 commit c79d1b2
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/r_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
#
#


name: R-ubuntu

on:
Expand All @@ -90,20 +89,27 @@ on:
jobs:
R-CMD-check:
runs-on: ubuntu-20.04

strategy:
matrix:
r-version: ['4.3.2', '4.2.0', '4.2.1']

env:
R_LIBS_USER: /home/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
RSPM: https://packagemanager.posit.co/cran/__linux__/focal/latest
RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/__linux__/focal/latest

steps:
- uses: actions/checkout@v3

- name: Cache R dependencies
uses: actions/cache@v2
with:
path: ~/R/x86_64-pc-linux-gnu-library/
key: ${{ runner.os }}-r-${{ hashFiles('**/renv.lock') }}
restore-keys: ${{ runner.os }}-r-
key: ${{ runner.os }}-r-${{ matrix.r-version }}-${{ hashFiles('**/renv.lock') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.r-version }}-

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand All @@ -113,12 +119,16 @@ jobs:

- name: Restore R environment
run: |
Rscript -e "if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')"
Rscript -e "renv::restore()"
if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')
renv::restore()
shell: Rscript {0}

- name: Install additional R packages
run: Rscript -e 'install.packages(c("knitr", "rmarkdown", "lsa", "purrr", "ggplot2"))'
shell: bash
run: |
install.packages(c("knitr", "rmarkdown", "lsa", "purrr", "ggplot2"))
install.packages('remotes')
remotes::install_github("davidycliao/flaiR", force = TRUE)
shell: Rscript {0}

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -142,19 +152,12 @@ jobs:
run: find . -name '*.pyc' -delete

- name: Check R environment status
run: Rscript -e "renv::status()"
run: renv::status()
shell: Rscript {0}

- name: Check R package (with virtual environment)
run: |
source flair_env/bin/activate
R CMD build . --no-build-vignettes
R CMD check *tar.gz --no-build-vignettes --no-manual --no-examples
shell: bash

env:
R_LIBS_USER: /home/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
RSPM: https://packagemanager.posit.co/cran/__linux__/focal/latest
RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/__linux__/focal/latest

0 comments on commit c79d1b2

Please sign in to comment.