Skip to content

ENH: Testing.

ENH: Testing. #14

Workflow file for this run

name: R-CMD-check ANTsRNet
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-22.04
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev python3 python3-pip
- name: Cache R packages
uses: actions/cache@v3
with:
path: ~/.cache/R
key: ${{ runner.os }}-r-pkgs-${{ hashFiles('DESCRIPTION') }}
restore-keys: |
${{ runner.os }}-r-pkgs-
- name: Cache reticulate environment
uses: actions/cache@v3
with:
path: ~/.local/share/r-reticulate
key: ${{ runner.os }}-reticulate-${{ hashFiles('DESCRIPTION') }}
restore-keys: |
${{ runner.os }}-reticulate-
- name: Install Python deps
run: |
python3 -m pip install --upgrade pip
pip install tensorflow==2.9.1 numpy h5py
- name: Install R dependencies with pinned reticulate
run: |
install.packages(c("remotes", "testthat", "tensorflow"), repos = "https://cloud.r-project.org")
remotes::install_version("reticulate", version = "1.34.0", repos = "https://cloud.r-project.org")
- name: Point reticulate to system Python
run: |
Rscript -e 'reticulate::use_python("/usr/bin/python3", required = TRUE)'
Rscript -e 'reticulate::py_config()'
- name: Install ANTsR
run: |
Rscript -e 'remotes::install_github("ANTsX/ANTsR", dependencies = TRUE)'
- name: Install ANTsRNet
run: |
Rscript -e 'remotes::install_local(".", dependencies = TRUE)'
- name: Run tests
run: |
Rscript -e 'testthat::test_dir("tests/testthat", reporter = testthat::SummaryReporter$new())'