-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (77 loc) · 2.96 KB
/
R-CMD-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Additional formatting taken from: https://github.com/r-lib/actions/blob/v2-branch/check-r-package/action.yaml
on:
push:
branches:
- dev
- main
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- name: Setup dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- name: Extra dependencies
id: extra-deps
run: |
install.packages("Matrix", type = "source", force = TRUE)
install.packages("irlba", type = "source", force = TRUE)
install.packages("TMB", type = "source", force = TRUE)
install.packages("glmmTMB", type = "source", force = TRUE)
shell: Rscript {0}
working-directory: '.'
- name: Check
id: rcmdcheck
run: |
## --------------------------------------------------------------------
options(crayon.enabled = TRUE)
cat("check-dir-path=", file.path(getwd(), "check"), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
check_results <- rcmdcheck::rcmdcheck(args = c("--no-vignettes", "--no-manual", "--as-cran"), build_args = c("--no-build-vignettes", "--no-manual"), check_dir = "check", error_on = "error")
shell: Rscript {0}
working-directory: '.'
- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
echo ::group::Show testthat output
find check -name 'testthat.Rout*' -exec cat '{}' \; || true
echo ::endgroup::
shell: bash
working-directory: '.'
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}
- name: Upload snapshots
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-testthat-snapshots
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps
if-no-files-found: ignore