Skip to content

Commit 7828fee

Browse files
authored
Merge pull request #140 from StoXProject/release1.4
Release1.4
2 parents 2cb00c9 + 8b52710 commit 7828fee

File tree

105 files changed

+4367
-759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4367
-759
lines changed

Diff for: .github/workflows/check-full.yaml

+127-64
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ on:
22
push:
33
branches:
44
- master
5+
- develop
6+
- testing
57
pull_request:
68
branches:
79
- master
10+
- develop
11+
- testing
812

913
name: R-CMD-check
1014

@@ -21,27 +25,15 @@ jobs:
2125
config:
2226
# for windows and mac all builds are pushed to drat repo on merge to master (except pre-release builds), except 'next'
2327

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
3130

32-
# 2023-08-23 fails, not getting Reca. Because it is not built yet for windows and next or 4.3.
3331
- {os: windows-latest, r: 'next', pkgext: '.zip'}
3432
- {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"}
3933

4034
- {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"}
4537

4638
env:
4739
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
@@ -50,11 +42,15 @@ jobs:
5042

5143
steps:
5244

53-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
5446

5547
- 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'
5749
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
5854
curl "https://raw.githubusercontent.com/StoXProject/testingRepo/main/scripts/checktag-actions.sh" --output testingRepo_checktag.sh
5955
curl "https://raw.githubusercontent.com/StoXProject/testingRepo/main/scripts/deploy-actions.sh" --output testingRepo_deploy.sh
6056
chmod +x ./testingRepo_checktag.sh ./testingRepo_deploy.sh
@@ -74,23 +70,9 @@ jobs:
7470
- uses: r-lib/actions/setup-r@v2
7571
with:
7672
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
8573

8674
- uses: r-lib/actions/setup-pandoc@v2
8775

88-
- name: Anticipate Bintray shutdown
89-
if: runner.os == 'macOS'
90-
run: |
91-
brew update
92-
shell: bash
93-
9476
- name: Query dependencies
9577
run: |
9678
install.packages('remotes')
@@ -100,7 +82,7 @@ jobs:
10082

10183
- name: Cache R packages
10284
if: runner.os != 'Windows'
103-
uses: actions/cache@v3
85+
uses: actions/cache@v4
10486
with:
10587
path: ${{ env.R_LIBS_USER }}
10688
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
@@ -114,22 +96,26 @@ jobs:
11496
eval sudo $cmd
11597
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
11698
117-
- name: Install MacOS dependencies
99+
- name: Install MacOS system dependencies
118100
if: runner.os == 'macOS'
119101
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'
131117
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
133119
shell: bash
134120

135121
- name: Prepare for dependencies on Linux
@@ -159,31 +145,75 @@ jobs:
159145
}
160146
shell: Rscript {0}
161147

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+
162157

163158
- name: Install CRANdependencies
164159
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/"))
169187
shell: Rscript {0}
170188

189+
171190
- name: Session info
172191
run: |
173192
options(width = 100)
174193
pkgs <- installed.packages()[, "Package"]
175194
sessioninfo::session_info(pkgs, include_base = TRUE)
176195
shell: Rscript {0}
177196

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'
179208
env:
180209
_R_CHECK_CRAN_INCOMING_: false
210+
_R_CHECK_FORCE_SUGGESTS_ : true
181211
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
182212
shell: Rscript {0}
183213

184-
- name: Show testthat output
214+
- name: Show test output
185215
if: always()
186-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
216+
run: find check -name 'tinytest.Rout*' -exec cat '{}' \; || true
187217
shell: bash
188218

189219
- name: Upload check results
@@ -193,39 +223,72 @@ jobs:
193223
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
194224
path: check
195225

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')
198228
run: |
199229
pkgbuild::build(".", dest_path = ".", binary = FALSE)
200230
system(paste0("PKG_FREL=", Sys.getenv("PKG_FILE"), " >> ", Sys.getenv("GITHUB_ENV")))
201231
shell: Rscript {0}
202232

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')
205235
run: |
206236
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"))
207241
file.copy(Sys.getenv("PKG_FILE"), Sys.getenv("PKG_FREL"))
208242
shell: Rscript {0}
209243

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'
213247
env:
214248
BUILD_NUMBER: ${{ github.sha }}
215249
DRAT_DEPLOY_TOKEN: ${{ secrets.DRAT_DEPLOY_TOKEN }}
216250
run: . repo_deploy.sh
217251
shell: bash
218252

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'
221257
env:
222258
BUILD_NUMBER: ${{ github.sha }}
223259
DRAT_DEPLOY_TOKEN: ${{ secrets.DRAT_DEPLOY_TOKEN }}
224260
run: . testingRepo_deploy.sh
225261
shell: bash
226262

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'
229292
uses: ncipollo/release-action@v1
230293
with:
231294
allowUpdates: true

Diff for: .github/workflows/test-coverage.yaml

+44-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ on:
22
push:
33
branches:
44
- master
5-
pull_request:
6-
branches:
5+
- testing
76
- develop
87

98
name: test-coverage
@@ -29,14 +28,55 @@ jobs:
2928
install.packages('remotes')
3029
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
3130
shell: Rscript {0}
32-
31+
3332
- name: Install MacOS dependencies
3433
if: runner.os == 'macOS'
3534
run: |
3635
rm -f '/usr/local/bin/gfortran'
37-
brew install udunits proj
36+
rm -f '/usr/local/bin/2to3'
37+
rm -f '/usr/local/bin/2to3-3.11'
38+
rm -f '/usr/local/bin/idle3'
39+
rm -f '/usr/local/bin/idle3.11'
40+
rm -f '/usr/local/bin/pydoc3'
41+
rm -f '/usr/local/bin/pydoc3.11'
42+
rm -f '/usr/local/bin/python3'
43+
rm -f '/usr/local/bin/python3.11'
44+
rm -f '/usr/local/bin/python3-config'
45+
rm -f '/usr/local/bin/python3.11-config'
46+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=false # This prevents Homebrew from re-installing R, which will lead to .Platform$pkgType = "source".
47+
brew install gdal
3848
shell: bash
3949

50+
#
51+
# Install Reca (awlays from prod repo)
52+
#
53+
- name: Install Reca
54+
run: |
55+
remotes::install_cran("Reca", repos = c("https://stoxproject.github.io/repo/", "https://cloud.r-project.org/"))
56+
shell: Rscript {0}
57+
58+
59+
#
60+
# Install StoX dependencies, corresponding to release status (unstable, pre-release or release)
61+
#
62+
- name: Install R package dependencies from the unstableRepo
63+
if: (github.event_name == 'push' && github.ref_name == 'develop') || (github.event_name == 'pull_request' && github.base_ref == 'develop')
64+
run: |
65+
remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/unstableRepo/", "https://cloud.r-project.org/"))
66+
shell: Rscript {0}
67+
68+
- name: Install R package dependencies from the testingRepo
69+
if: (github.event_name == 'push' && github.ref_name == 'testing') || (github.event_name == 'pull_request' && github.base_ref == 'testing')
70+
run: |
71+
remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/testingRepo/", "https://cloud.r-project.org/"))
72+
shell: Rscript {0}
73+
74+
- name: Install R package dependencies from the official repo
75+
if: (github.event_name == 'push' && github.ref_name == 'master') || (github.event_name == 'pull_request' && github.base_ref == 'master')
76+
run: |
77+
remotes::install_deps(dependencies = TRUE, repos = c("https://stoxproject.github.io/repo/", "https://cloud.r-project.org/"))
78+
shell: Rscript {0}
79+
4080
- name: Install dependencies
4181
run: |
4282
remotes::install_deps(dependencies = TRUE)

0 commit comments

Comments
 (0)