Skip to content

Commit

Permalink
Add R CMD check tractor.base to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Feb 23, 2024
1 parent 2a93c4d commit 311631f
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ defaults:
shell: bash

jobs:
# This workflow contains a single job called "check"
check:
# Main TractoR tests, on Linux only
integration-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -51,3 +51,47 @@ jobs:

- name: Run tests
run: make deeptest

# Standard R CMD check on tractor.base package (Linux and Windows)
base-check:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
R: [ release, devel ]

runs-on: ${{ matrix.os }}

# No submodules needed in this case, as we'll install dependencies from CRAN
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: false

- name: Install and set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.R }}

- 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 tractor.base

- name: Check package
run: R CMD check --no-manual tractor.base*tar.gz

# Upload the check directory as an artefact on failure
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-R${{ matrix.R }}-check
path: tractor.base.Rcheck

0 comments on commit 311631f

Please sign in to comment.