-
Notifications
You must be signed in to change notification settings - Fork 15
226 lines (191 loc) · 7.2 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches-ignore: [gh-pages]
pull_request:
branches-ignore: [gh-pages]
name: R-CMD-check
concurrency:
group: ${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
LATEX_PACKAGES: "oberdiek grfext environ trimspaces etoolbox upquote babel-english pgf xcolor algorithms relsize tocbibind appendix tocloft enumitem listings tcolorbox collection-fontsrecommended framed inconsolata microtype underscore"
R_KEEP_PKG_SOURCE: yes
jobs:
R-CMD-check:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
name: Check ${{ matrix.os }} (${{ matrix.r }})
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, windows-latest, macos-13, macos-14 ]
r: [ release ]
include:
# Use 4.0 to check with rtools40's older compiler
- { os: windows-latest, r: '4.0' }
# Minimum supported version.
- {os: ubuntu-20.04, r: '4.0'}
# Use latest ubuntu to make it easier to install dependencies
- { os: ubuntu-24.04, r: 'devel', http-user-agent: 'release' }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: "[macOS] Install openmpi"
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
- name: "[Linux] Install openmpi"
if: runner.os == 'Linux'
run: sudo apt-get update -y && sudo apt install -y libopenmpi-dev
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r }}
http-user-agent: ${{ matrix.http-user-agent }}
use-public-rspm: true
# special branch required for TeX Live 2023 fix
- uses: r-lib/actions/setup-tinytex@v2-branch
- run: tlmgr --version
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
if: runner.os != 'macOS'
with:
extra-packages: |
any::rcmdcheck
mlr=?ignore-before-r=4.0.0
Rmpi=?ignore-unavailable
needs: check
cache-version: 1
install-pandoc: true
- uses: r-lib/actions/setup-r-dependencies@v2
if: runner.os == 'macOS'
with:
extra-packages: |
any::rcmdcheck
mlr=?ignore-before-r=4.0.0
Rmpi=?ignore
needs: check
cache-version: 1
install-pandoc: true
- name: Check (as CRAN)
env:
NOT_CRAN: false
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
build_args: 'c("--compact-vignettes=gs+qpdf")'
- name: Check
env:
NOT_CRAN: true
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--run-donttest", "--timings")'
- name: Show testthat output
if: failure()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
coverage:
needs: R-CMD-check
name: Coverage
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 30
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2-branch
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, mlr=?ignore, Rmpi=?ignore, local::.
needs: coverage
install-pandoc: true
- name: Test coverage
env:
NOT_CRAN: true
COVR_COVERAGE: true
run: |
options(covr.fix_parallel_mcexit = TRUE)
coverage <- covr::package_coverage(type = "all",
quiet = FALSE, clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package"),
commentDonttest = FALSE)
print(coverage)
covr::codecov(coverage = coverage)
shell: Rscript {0}
- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Show failures
if: failure()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -type d | xargs -I 'X' find 'X' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload test results
if: failure()
uses: actions/upload-artifact@main
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
pkgdown:
needs: R-CMD-check
if: contains('
refs/heads/master
refs/heads/main
', github.ref) && github.event_name == 'push'
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
timeout-minutes: 30
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2-branch
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, mlr=?ignore, Rmpi=?ignore, any::remotes
needs: website
install-pandoc: true
- name: Install package with vignettes
run: |
remotes::install_local(".", build = TRUE, upgrade = "never", force = TRUE, build_opts = c("--no-resave-data"), build_manual = TRUE, build_vignettes = TRUE)
dir.create("./pkgdown/assets/")
file.copy(system.file("doc/irace-package.pdf",package="irace", mustWork=TRUE), "./pkgdown/assets/", overwrite=TRUE)
shell: Rscript {0}
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: success() && github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: true
single-commit: true
branch: gh-pages
folder: docs