ENH: Testing. #16
Workflow file for this run
This file contains hidden or 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-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: | | |
| Rscript -e ' | |
| 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: Configure GitHub PAT | |
| run: | | |
| echo "GITHUB_PAT=${{ secrets.GH_PAT }}" >> $GITHUB_ENV | |
| echo "GITHUB_PAT=${{ secrets.GH_PAT }}" >> ~/.Renviron | |
| - 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())' |