-
-
Notifications
You must be signed in to change notification settings - Fork 405
161 lines (156 loc) · 5.81 KB
/
check.yml
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
on:
push:
branches: [master, devel]
pull_request:
branches: [master, devel]
schedule:
- cron: '33 4 * * *' # work 4:33 in the morning
name: check
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
WARNINGS_ARE_ERRORS: 1
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_TESTS_NLINES_: 0 # disable limiting of output lines
_R_CHECK_CRAN_INCOMING_: false
jobs:
check:
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # continue runs even when a parallel run failed
matrix:
# run on ubuntu, macos, windows. 20.04 is more recent than ubuntu-latest, currently.
os: [macos-latest, windows-latest, ubuntu-latest]
action: [check]
r: [release]
include:
# additionally run r-devel, but only on ubuntu, and an old R version on an old ubuntu
- os: ubuntu-latest
action: check
r: devel
- os: ubuntu-20.04
action: check
r: '4.1'
- os: ubuntu-latest
action: coverage
r: release
- os: ubuntu-latest
action: githubversions
r: release
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
id: install-r
with:
r-version: ${{ matrix.r }}
- if: runner.os == 'Linux'
name: apt-get update
run: sudo apt-get update
- name: Install curl for Ubuntu
# necessary for pkgdown & covr, so we do that on ubuntu-latest / R release only
if: ${{ matrix.r == 'release' && matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2-branch
- name: Create Cache Key
shell: Rscript {0}
run: |
if (!require("remotes", quietly = TRUE)) install.packages("remotes")
writeLines(capture.output(print(remotes::dev_package_deps())), ".github/deps.txt")
- uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.os }}-${{ steps.install-r.outputs.installed-r-version }}-${{ hashFiles('.github/deps.txt') }}
- shell: Rscript {0}
name: install necessary build env packages
run: for (req in c("remotes", "roxygen2", "covr", "pkgdown")) if (!require(req, quietly = TRUE)) install.packages(req)
- if: runner.os == 'Linux'
name: install system requirements
run: |
while read -r depinst ; do
echo "> $depinst"
eval sudo $depinst
done < <( Rscript -e "writeLines(remotes::system_requirements('ubuntu', '$( . /etc/os-release ; echo $VERSION_ID )'))")
- shell: Rscript {0}
name: install package dependencies
run: |
remotes::install_deps(dependencies = TRUE)
- name: install github versions
if: ${{ matrix.action == 'githubversions' }}
shell: Rscript {0}
run: |
system("sudo apt-get install libhiredis-dev")
remotes::install_github("mlr-org/paradox")
remotes::install_github("mlr-org/bbotk")
remotes::install_github("mlr-org/mlr3tuning")
- name: Session Info
shell: Rscript {0}
run: |
options(width = 200)
installed.packages()[, c("Package", "Version", "Built")]
sessionInfo()
- name: Document
shell: Rscript {0}
run: |
roxygen2::roxygenise()
system("attic/clean_man.sh")
- if: runner.os == 'windows'
name: Remove hypertarget from Latex for Windows
run: "sed -i 's/\\\\hypertarget{[^}]*}//g' man/*"
- if: runner.os == 'windows'
name: Install tinytex packages
shell: Rscript {0}
run: |
library(tinytex)
tlmgr_version()
tlmgr_update()
tlmgr_install('collection-latexrecommended')
tlmgr_install('collection-fontsrecommended')
tlmgr(c('list', '--only-installed'))
- name: Build
if: ${{ matrix.action != 'coverage' }}
working-directory: ..
run: 'R CMD build */'
- name: Check
if: ${{ matrix.action != 'coverage' }}
working-directory: ..
run: 'R CMD check --as-cran --run-donttest *.tar.gz'
- name: Coverage
if: ${{ matrix.action == 'coverage' }}
shell: Rscript {0}
run: covr::codecov(quiet = FALSE, type = "tests")
- name: install
if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' }}
working-directory: ..
run: 'R CMD INSTALL *.tar.gz'
- name: Build Docs
if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' }}
shell: Rscript {0}
run: |
pkgdown::build_site()
roxygen2::roxygenise()
tools::buildVignettes(dir = ".")
- name: Deploy Docs
if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' && github.ref == 'refs/heads/master' }}
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git checkout --orphan gh-pages
git --work-tree=docs add --all
git --work-tree=docs commit -m "gh-pages"
git push origin HEAD:gh-pages --force
- name: Install Log
if: ${{ failure() }}
working-directory: ..
run: 'cat *.Rcheck/00install.out'
- name: Check Log
if: ${{ failure() }}
working-directory: ..
run: 'cat *.Rcheck/00check.log'
- name: Latex Log
if: ${{ failure() }}
working-directory: ..
run: 'cat *.Rcheck/Rdlatex.log'