Merge pull request #178 from davidycliao/dependabot/pip/torch-2.4.1 #402
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: R-ubuntu | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
R-CMD-check: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
r-version: ['4.3.2', '4.2.0', '4.2.1'] | |
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- | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Restore R environment | |
run: | | |
Rscript -e "if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')" | |
Rscript -e "renv::restore()" | |
- name: Install additional R packages | |
run: Rscript -e 'install.packages(c("knitr", "rmarkdown", "lsa", "purrr", "ggplot2"))' | |
shell: bash | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10.x' | |
- name: Install Python virtualenv | |
run: pip install virtualenv | |
- name: Create Python virtual environment | |
run: virtualenv flair_env | |
- name: Install Python dependencies in virtual environment | |
run: | | |
source flair_env/bin/activate | |
pip install --upgrade pip | |
pip install scipy==1.12.0 # test | |
pip install flair | |
- name: Remove Python cache files | |
run: find . -name '*.pyc' -delete | |
- name: Check R environment status | |
run: Rscript -e "renv::status()" | |
- name: Synchronize R environment | |
run: Rscript -e "renv::sync()" | |
- 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 | |