2
2
push :
3
3
branches :
4
4
- master
5
+ - develop
6
+ - testing
5
7
pull_request :
6
8
branches :
7
9
- master
10
+ - develop
11
+ - testing
8
12
9
13
name : R-CMD-check
10
14
@@ -21,27 +25,15 @@ jobs:
21
25
config :
22
26
# for windows and mac all builds are pushed to drat repo on merge to master (except pre-release builds), except 'next'
23
27
24
- # 2023-08-23 fails, not getting Reca. Because it is not built yet for macos and next or 4.3.
25
- # - {os: macOS-latest, r: 'next', pkgext: '.tgz'}
26
- # - {os: macOS-latest, r: '4.3', pkgext: '.tgz'}
27
-
28
- - {os: macOS-latest, r: '4.2', pkgext: '.tgz'}
29
- - {os: macOS-latest, r: '4.1', pkgext: '.tgz'}
30
- - {os: macOS-latest, r: '4.0', pkgext: '.tgz'}
28
+ - {os: macOS-latest, r: 'next', pkgext: '.tgz'} # will be tested without suggests
29
+ - {os: macOS-latest, r: '4.3', pkgext: '.tgz'} # will be tested without suggests
31
30
32
- # 2023-08-23 fails, not getting Reca. Because it is not built yet for windows and next or 4.3.
33
31
- {os: windows-latest, r: 'next', pkgext: '.zip'}
34
32
- {os: windows-latest, r: '4.3', pkgext: '.zip'}
35
-
36
- - {os: windows-latest, r: '4.2', pkgext: '.zip'}
37
- - {os: windows-latest, r: '4.1', pkgext: '.zip'}
38
- - {os: windows-latest, r: '4.0', pkgext: '.zip', rspm: "https://cloud.r-project.org"}
39
33
40
34
- {os: ubuntu-latest, r: 'next', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
41
- - {os: ubuntu-22.04, r: '4.2', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
42
- # 4.1 is pushed to drat repo on merge to master for ubunutu (except pre-release builds), update script if 4.1 is taken out
43
- - {os: ubuntu-20.04, r: '4.1', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
44
- - {os: ubuntu-20.04, r: '4.0', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
35
+ # 4.3 is pushed to drat repo on merge to master for ubunutu (except pre-release builds), update script if 4.3 is taken out
36
+ - {os: ubuntu-22.04, r: '4.3', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
45
37
46
38
env :
47
39
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
@@ -50,11 +42,15 @@ jobs:
50
42
51
43
steps :
52
44
53
- - uses : actions/checkout@v3
45
+ - uses : actions/checkout@v4
54
46
55
47
- name : Do autorelease increment, tagging, and environment setup
56
- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
48
+ if : github.event_name == 'push'
57
49
run : |
50
+ curl "https://raw.githubusercontent.com/StoXProject/unstableRepo/main/scripts/checktag-actions.sh" --output unstableRepo_checktag.sh
51
+ curl "https://raw.githubusercontent.com/StoXProject/unstableRepo/main/scripts/deploy-actions.sh" --output unstableRepo_deploy.sh
52
+ chmod +x ./unstableRepo_checktag.sh ./unstableRepo_deploy.sh
53
+ . unstableRepo_checktag.sh
58
54
curl "https://raw.githubusercontent.com/StoXProject/testingRepo/main/scripts/checktag-actions.sh" --output testingRepo_checktag.sh
59
55
curl "https://raw.githubusercontent.com/StoXProject/testingRepo/main/scripts/deploy-actions.sh" --output testingRepo_deploy.sh
60
56
chmod +x ./testingRepo_checktag.sh ./testingRepo_deploy.sh
74
70
- uses : r-lib/actions/setup-r@v2
75
71
with :
76
72
r-version : ${{ matrix.config.r }}
77
- rtools-version : ${{ matrix.config.rtools }}
78
- http-user-agent : ${{ matrix.config.http-user-agent }}
79
-
80
- - name : Anticipate Bintray shutdown
81
- if : runner.os == 'macOS'
82
- run : |
83
- brew update
84
- shell : bash
85
73
86
74
- uses : r-lib/actions/setup-pandoc@v2
87
75
88
- - name : Anticipate Bintray shutdown
89
- if : runner.os == 'macOS'
90
- run : |
91
- brew update
92
- shell : bash
93
-
94
76
- name : Query dependencies
95
77
run : |
96
78
install.packages('remotes')
100
82
101
83
- name : Cache R packages
102
84
if : runner.os != 'Windows'
103
- uses : actions/cache@v3
85
+ uses : actions/cache@v4
104
86
with :
105
87
path : ${{ env.R_LIBS_USER }}
106
88
key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
@@ -114,22 +96,26 @@ jobs:
114
96
eval sudo $cmd
115
97
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
116
98
117
- - name : Install MacOS dependencies
99
+ - name : Install MacOS system dependencies
118
100
if : runner.os == 'macOS'
119
101
run : |
120
- rm -f '/usr/local/bin/gfortran'
121
- rm -f '/usr/local/bin/2to3'
122
- rm -f '/usr/local/bin/2to3-3.11'
123
- rm -f '/usr/local/bin/idle3'
124
- rm -f '/usr/local/bin/idle3.11'
125
- rm -f '/usr/local/bin/pydoc3'
126
- rm -f '/usr/local/bin/pydoc3.11'
127
- rm -f '/usr/local/bin/python3'
128
- rm -f '/usr/local/bin/python3.11'
129
- rm -f '/usr/local/bin/python3-config'
130
- rm -f '/usr/local/bin/python3.11-config'
102
+ # gfortran may not exist in a period after a new R minor release:
103
+ gfortranFile='/usr/local/bin/gfortran'
104
+ if [ -f "$gfortranFile" ] ; then
105
+ rm "$gfortranFile"
106
+ fi
107
+ rm '/usr/local/bin/2to3'
108
+ rm '/usr/local/bin/2to3-3.11'
109
+ rm '/usr/local/bin/idle3.11'
110
+ rm '/usr/local/bin/idle3'
111
+ rm '/usr/local/bin/pydoc3'
112
+ rm '/usr/local/bin/python3'
113
+ rm '/usr/local/bin/python3-config'
114
+ rm '/usr/local/bin/pydoc3.11'
115
+ rm '/usr/local/bin/python3.11'
116
+ rm '/usr/local/bin/python3.11-config'
131
117
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=false # This prevents Homebrew from re-installing R, which will lead to .Platform$pkgType = "source".
132
- brew install gdal
118
+ brew install gdal udunits
133
119
shell : bash
134
120
135
121
- name : Prepare for dependencies on Linux
@@ -159,31 +145,75 @@ jobs:
159
145
}
160
146
shell : Rscript {0}
161
147
148
+ #
149
+ # Install Reca (awlays from prod repo)
150
+ #
151
+ - name : Install Reca
152
+ run : |
153
+ remotes::install_cran("Reca", repos = c("https://stoxproject.github.io/repo/", "https://cloud.r-project.org/"))
154
+ shell : Rscript {0}
155
+
156
+
162
157
163
158
- name : Install CRANdependencies
164
159
run : |
165
- remotes::install_cran("rcmdcheck")
166
- #remotes::install_cran("git2r")
167
- remotes::install_cran("drat")
168
- remotes::install_cran("sessioninfo")
160
+ install.packages(c("rcmdcheck", "git2r", "sessioninfo", "knitr", "remotes"))
161
+
162
+ # Using the latest drat that supports big sur (after inputs from us).
163
+ # When the next drat appears on CRAN this can be changed to install from CRAN:
164
+ remotes::install_github(repo = 'eddelbuettel/drat', dependencies = FALSE)
165
+
166
+ shell : Rscript {0}
167
+
168
+ #
169
+ # Install StoX dependencies, corresponding to release status (unstable, pre-release or release)
170
+ #
171
+ - name : Install R package dependencies from the unstableRepo
172
+ if : (github.event_name == 'push' && github.ref_name == 'develop') || (github.event_name == 'pull_request' && github.base_ref == 'develop')
173
+ run : |
174
+ remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/unstableRepo/", "https://cloud.r-project.org/"))
175
+ shell : Rscript {0}
176
+
177
+ - name : Install R package dependencies from the testingRepo
178
+ if : (github.event_name == 'push' && github.ref_name == 'testing') || (github.event_name == 'pull_request' && github.base_ref == 'testing')
179
+ run : |
180
+ remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/testingRepo/", "https://cloud.r-project.org/"))
181
+ shell : Rscript {0}
182
+
183
+ - name : Install R package dependencies from the official repo
184
+ if : (github.event_name == 'push' && github.ref_name == 'master') || (github.event_name == 'pull_request' && github.base_ref == 'master')
185
+ run : |
186
+ remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/repo/", "https://cloud.r-project.org/"))
169
187
shell : Rscript {0}
170
188
189
+
171
190
- name : Session info
172
191
run : |
173
192
options(width = 100)
174
193
pkgs <- installed.packages()[, "Package"]
175
194
sessioninfo::session_info(pkgs, include_base = TRUE)
176
195
shell : Rscript {0}
177
196
178
- - name : Check
197
+ # turn off testing of suggestions for configurations where Reca is not provided in StoX package repositories
198
+ - name : Check without suggest-dependencies
199
+ if : runner.os == 'macOS'
200
+ env :
201
+ _R_CHECK_CRAN_INCOMING_ : false
202
+ _R_CHECK_FORCE_SUGGESTS_ : false
203
+ run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
204
+ shell : Rscript {0}
205
+
206
+ - name : Check with suggest-dependencies
207
+ if : runner.os != 'macOS'
179
208
env :
180
209
_R_CHECK_CRAN_INCOMING_ : false
210
+ _R_CHECK_FORCE_SUGGESTS_ : true
181
211
run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
182
212
shell : Rscript {0}
183
213
184
- - name : Show testthat output
214
+ - name : Show test output
185
215
if : always()
186
- run : find check -name 'testthat .Rout*' -exec cat '{}' \; || true
216
+ run : find check -name 'tinytest .Rout*' -exec cat '{}' \; || true
187
217
shell : bash
188
218
189
219
- name : Upload check results
@@ -193,39 +223,72 @@ jobs:
193
223
name : ${{ runner.os }}-r${{ matrix.config.r }}-results
194
224
path : check
195
225
196
- - name : Build package source archive
197
- if : runner.os == 'Linux' && matrix.config.r == '4.1 ' && github.event_name == 'push' && github.ref == 'refs/heads/ master'
226
+ - name : Build package source archive from branches develop, testing and master
227
+ if : runner.os == 'Linux' && matrix.config.r == '4.3 ' && github.event_name == 'push' && ( github.ref_name == 'master' || github.ref_name == 'testing' || github.ref_name == 'develop')
198
228
run : |
199
229
pkgbuild::build(".", dest_path = ".", binary = FALSE)
200
230
system(paste0("PKG_FREL=", Sys.getenv("PKG_FILE"), " >> ", Sys.getenv("GITHUB_ENV")))
201
231
shell : Rscript {0}
202
232
203
- - name : Build package binary archive
204
- if : (runner.os == 'Windows' || runner.os == 'macOS') && github.event_name == 'push' && github.ref == 'refs/heads/ master'
233
+ - name : Build package binary archive from branches develop, testing and master for Windows and macOS (this builds also on matrix.config.r = release, which can or can not be a duplicate)
234
+ if : (runner.os == 'Windows' || runner.os == 'macOS') && github.event_name == 'push' && ( github.ref_name == 'master' || github.ref_name == 'testing' || github.ref_name == 'develop')
205
235
run : |
206
236
pkgbuild::build(".", dest_path = ".", binary = TRUE)
237
+ print("PKG_FILE")
238
+ print(Sys.getenv("PKG_FILE"))
239
+ print("PKG_FREL")
240
+ print(Sys.getenv("PKG_FREL"))
207
241
file.copy(Sys.getenv("PKG_FILE"), Sys.getenv("PKG_FREL"))
208
242
shell : Rscript {0}
209
243
210
- # Upload to drat repo only for one version (4.1) on Linux, and only for all the specifically given R versions for macOS and Windows (not next). Next is included to detect errors immediatelly when the new R is patched :
211
- - name : Upload to DRAT repo
212
- if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.1 ') ) && github.event_name == 'push' && github.ref == 'refs/heads/ master'
244
+ # # 5a. Upload to the official (DRAT) repo, but only from the master branch. Here we skip the matrix.config.r = release, as a new StoX release should be ready shortly after each R minor release and listed specifically in the matrix.config :
245
+ - name : Upload to the official ( DRAT) repo
246
+ if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.3 ') ) && github.event_name == 'push' && github.ref_name == 'master'
213
247
env :
214
248
BUILD_NUMBER : ${{ github.sha }}
215
249
DRAT_DEPLOY_TOKEN : ${{ secrets.DRAT_DEPLOY_TOKEN }}
216
250
run : . repo_deploy.sh
217
251
shell : bash
218
252
219
- - name : Upload to DRAT testingRepo
220
- if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.1') ) && github.event_name == 'push' && github.ref == 'refs/heads/master'
253
+
254
+ # # 5b. Upload to the (DRAT) testingRepo, but only from the testing branch. Here we skip the matrix.config.r = release, as a new StoX release should be ready shortly after each R minor release and listed specifically in the matrix.config:
255
+ - name : Upload to the testing (DRAT) repo
256
+ if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.3') ) && github.event_name == 'push' && github.ref_name == 'testing'
221
257
env :
222
258
BUILD_NUMBER : ${{ github.sha }}
223
259
DRAT_DEPLOY_TOKEN : ${{ secrets.DRAT_DEPLOY_TOKEN }}
224
260
run : . testingRepo_deploy.sh
225
261
shell : bash
226
262
227
- - name : Create release and upload files
228
- if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.1') ) && github.event_name == 'push' && github.ref == 'refs/heads/master'
263
+
264
+ # # 5c. Upload to the (DRAT) unstableRepo, but only from the develop branch. Here we skip the matrix.config.r = release, as a new StoX release should be ready shortly after each R minor release and listed specifically in the matrix.config:
265
+ - name : Upload to the unstable (DRAT) repo
266
+ if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.3') ) && github.event_name == 'push' && github.ref_name == 'develop'
267
+ env :
268
+ BUILD_NUMBER : ${{ github.sha }}
269
+ DRAT_DEPLOY_TOKEN : ${{ secrets.DRAT_DEPLOY_TOKEN }}
270
+ run : . unstableRepo_deploy.sh
271
+ shell : bash
272
+
273
+
274
+
275
+ # ##############################
276
+ # ### 6. Release on GitHub: ####
277
+ # ##############################
278
+
279
+ - name : Create release on GitHub and upload files for testing branch
280
+ if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.3') ) && github.event_name == 'push' && github.ref_name == 'testing'
281
+ uses : ncipollo/release-action@v1
282
+ with :
283
+ allowUpdates : true
284
+ commit : testing
285
+ tag : ${{ env.FINAL_TAG }}
286
+ name : ${{ env.FINAL_TAG }}
287
+ artifacts : ${{ env.PKG_REPO }}/${{ env.PKG_FREL }}
288
+ token : ${{ secrets.GITHUB_TOKEN }}
289
+
290
+ - name : Create release on GitHub and upload files for master branch
291
+ if : ( (runner.os == 'Windows' && matrix.config.r != 'next') || (runner.os == 'macOS' && matrix.config.r != 'next') || (runner.os == 'Linux' && matrix.config.r == '4.3') ) && github.event_name == 'push' && github.ref_name == 'master'
229
292
uses : ncipollo/release-action@v1
230
293
with :
231
294
allowUpdates : true
0 commit comments