Skip to content

Try again

Try again #63

Workflow file for this run

name: CI
on: [ push, pull_request ]
defaults:
run:
shell: bash
jobs:
# The main R checks
r-check:
# Build and check on Linux and Windows
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
# The type of runner that this job runs on
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
# Install and set up R
- uses: r-lib/actions/setup-r@v2
# The curl package (upon which covr depends) requires libcurl
- name: Install upstream system dependencies
if: runner.os == 'Linux'
run: sudo apt-get install -y libcurl4-openssl-dev
- name: Parse and install dependencies
run: |
deps <- read.dcf("DESCRIPTION", c("Depends","Imports","LinkingTo","Suggests","Enhances"))
deps <- na.omit(unlist(strsplit(deps, "\\s*,\\s*", perl=TRUE)))
deps <- setdiff(unique(sub("\\s*\\([^\\)]+\\)\\s*$", "", deps, perl=TRUE)), c("R", rownames(installed.packages())))
install.packages(deps)
shell: Rscript {0}
- name: Build package
run: R CMD build .
- name: Check package
run: R CMD check --no-manual *tar.gz || { mv *.Rcheck Rcheck; false; }
# Having checked the package, we install it for use with the clients
- name: Install package
run: R CMD INSTALL *tar.gz
- name: Check client packages
run: |
R CMD build clients/nifti1c && R CMD check --no-manual nifti1c*.tar.gz || ( cat nifti1c.Rcheck/00install.out >>Rcheck; exit 1 )
R CMD build clients/nifti2cpp && R CMD check --no-manual nifti2cpp*.tar.gz || ( cat nifti2cpp.Rcheck/00install.out >>Rcheck; exit 1 )
# Upload the check directory as an artefact on failure
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-results
path: Rcheck
- name: Update test coverage
run: Rscript -e 'covr::codecov()'
# Checks for standalone usage (without R)
standalone-check:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Compile standalone programs
run: cd standalone && make -f nii_info.make
- name: Test standalone programs
run: |
standalone/nii_info inst/extdata/example.nii.gz
standalone/nii2_info inst/extdata/example.nii.gz