Skip to content

Update description, news and API version #79

Update description, news and API version

Update description, news and API version #79

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)
ubuntu-standalone-check:
runs-on: ubuntu-latest
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
# Standalone check on Windows
windows-standalone-check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
# Set up Developer Command Prompt to see MSVC commands
- uses: ilammy/msvc-dev-cmd@v1
- name: Compile standalone programs
shell: pwsh
run: cd standalone; nmake /f nii_info.nmake
- name: Test standalone programs
shell: pwsh
run: |
standalone/nii_info inst/extdata/example.nii.gz
standalone/nii2_info inst/extdata/example.nii.gz