1+ name : R Package Check
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ pull_request :
7+ branches : [ main, master ]
8+ workflow_dispatch :
9+
10+ jobs :
11+ R-CMD-check :
12+ runs-on : ${{ matrix.config.os }}
13+
14+ name : ${{ matrix.config.os }} (${{ matrix.config.r }})
15+
16+ strategy :
17+ fail-fast : false
18+ matrix :
19+ config :
20+ - {os: ubuntu-latest, r: 'release'}
21+ - {os: ubuntu-latest, r: 'devel'}
22+ - {os: windows-latest, r: 'release'}
23+ - {os: macOS-latest, r: 'release'}
24+
25+ env :
26+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
27+ R_KEEP_PKG_SOURCE : yes
28+ NOT_CRAN : true
29+
30+ steps :
31+ - uses : actions/checkout@v4
32+
33+ - uses : r-lib/actions/setup-pandoc@v2
34+
35+ - uses : r-lib/actions/setup-r@v2
36+ with :
37+ r-version : ${{ matrix.config.r }}
38+ use-public-rspm : true
39+
40+ - name : Install system dependencies (Linux)
41+ if : runner.os == 'Linux'
42+ run : |
43+ sudo apt-get update
44+ sudo apt-get install -y \
45+ libcurl4-openssl-dev \
46+ libssl-dev \
47+ libxml2-dev \
48+ libharfbuzz-dev \
49+ libfribidi-dev \
50+ libgit2-dev \
51+ libgsl-dev
52+
53+ - name : Install system dependencies (macOS)
54+ if : runner.os == 'macOS'
55+ run : |
56+ brew install gsl
57+
58+ - uses : r-lib/actions/setup-r-dependencies@v2
59+ with :
60+ extra-packages : any::rcmdcheck, any::devtools
61+ needs : check
62+
63+ - name : Check package
64+ uses : r-lib/actions/check-r-package@v2
65+ with :
66+ upload-snapshots : true
67+ build_args : ' c("--no-manual","--compact-vignettes=gs+qpdf")'
68+
69+ - name : Show testthat output
70+ if : always()
71+ run : |
72+ find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
73+ shell : bash
74+
75+ - name : Upload check results
76+ if : failure()
77+ uses : actions/upload-artifact@v4
78+ with :
79+ name : ${{ runner.os }}-r${{ matrix.config.r }}-results
80+ path : check
81+
82+ lint :
83+ runs-on : ubuntu-latest
84+
85+ steps :
86+ - uses : actions/checkout@v4
87+
88+ - uses : r-lib/actions/setup-r@v2
89+ with :
90+ use-public-rspm : true
91+
92+ - uses : r-lib/actions/setup-r-dependencies@v2
93+ with :
94+ extra-packages : any::lintr, local::.
95+ needs : lint
96+
97+ - name : Lint
98+ run : |
99+ # Only lint if lintr is available (it's in Suggests)
100+ if (requireNamespace("lintr", quietly = TRUE)) {
101+ lintr::lint_package()
102+ } else {
103+ cat("lintr not available, skipping lint check\n")
104+ }
105+ shell : Rscript {0}
106+
107+ test-coverage :
108+ runs-on : ubuntu-latest
109+
110+ steps :
111+ - uses : actions/checkout@v4
112+
113+ - uses : r-lib/actions/setup-r@v2
114+ with :
115+ use-public-rspm : true
116+
117+ - uses : r-lib/actions/setup-r-dependencies@v2
118+ with :
119+ extra-packages : any::covr, local::.
120+ needs : coverage
121+
122+ - name : Test coverage
123+ run : |
124+ if (requireNamespace("covr", quietly = TRUE)) {
125+ covr::codecov(
126+ quiet = FALSE,
127+ clean = FALSE,
128+ install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
129+ )
130+ } else {
131+ cat("covr not available, skipping coverage\n")
132+ }
133+ shell : Rscript {0}
0 commit comments