Skip to content

Commit cd3da48

Browse files
authored
Merge pull request #958 from stan-dev/fix-rtools44
Fix Github Workflows
2 parents 9580b06 + 6c67158 commit cd3da48

File tree

4 files changed

+34
-120
lines changed

4 files changed

+34
-120
lines changed

.github/workflows/R-CMD-check-wsl.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,9 @@ jobs:
4040
- uses: r-lib/actions/[email protected]
4141
- uses: r-lib/actions/[email protected]
4242

43-
- name: Query dependencies
44-
run: |
45-
install.packages('remotes')
46-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
47-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
48-
shell: Rscript {0}
49-
50-
- name: Install dependencies
51-
run: |
52-
remotes::install_deps(dependencies = TRUE)
53-
remotes::install_cran("rcmdcheck")
54-
remotes::install_local(path = ".", INSTALL_opts = "--no-test-load")
55-
install.packages("curl")
56-
shell: Rscript {0}
43+
- uses: r-lib/actions/[email protected]
44+
with:
45+
extra-packages: any::rcmdcheck, local::.
5746

5847
- uses: Vampire/setup-wsl@v3
5948
with:
@@ -82,11 +71,9 @@ jobs:
8271
sessioninfo::session_info(pkgs, include_base = TRUE)
8372
shell: Rscript {0}
8473

85-
- name: Check
74+
- uses: r-lib/actions/[email protected]
8675
env:
8776
_R_CHECK_CRAN_INCOMING_: false
88-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
89-
shell: Rscript {0}
9077

9178
- name: Show testthat output
9279
if: always()

.github/workflows/R-CMD-check.yaml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
config:
2626
- {os: macOS-latest, r: 'devel', rtools: ''}
2727
- {os: macOS-latest, r: 'release', rtools: ''}
28-
- {os: windows-latest, r: 'devel', rtools: ''}
29-
- {os: windows-latest, r: 'release', rtools: ''}
30-
- {os: windows-latest, r: 'oldrel', rtools: '42'}
31-
- {os: ubuntu-20.04, r: 'devel', rtools: ''}
32-
- {os: ubuntu-20.04, r: 'release', rtools: ''}
33-
- {os: ubuntu-20.04, r: 'oldrel', rtools: ''}
28+
- {os: windows-latest, r: 'devel', rtools: '44'}
29+
- {os: windows-latest, r: 'release', rtools: '44'}
30+
- {os: windows-latest, r: 'oldrel', rtools: '43'}
31+
- {os: ubuntu-latest, r: 'devel', rtools: ''}
32+
- {os: ubuntu-latest, r: 'release', rtools: ''}
33+
- {os: ubuntu-latest, r: 'oldrel', rtools: ''}
3434
env:
3535
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3636
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -49,42 +49,16 @@ jobs:
4949

5050
- uses: actions/checkout@v4
5151

52-
- name: Install system dependencies
53-
if: runner.os == 'Linux'
54-
run: |
55-
sudo apt-get update
56-
sudo apt-get install -y libcurl4-openssl-dev || true
57-
sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev || true
58-
5952
- uses: r-lib/actions/[email protected]
6053
with:
6154
r-version: ${{ matrix.config.r }}
6255
rtools-version: ${{ matrix.config.rtools }}
63-
- uses: r-lib/actions/[email protected]
6456

65-
- name: Query dependencies
66-
run: |
67-
install.packages('remotes')
68-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
69-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
70-
shell: Rscript {0}
57+
- uses: r-lib/actions/[email protected]
7158

72-
- name: Cache R packages
73-
if: runner.os != 'Windows'
74-
uses: actions/cache@v4
59+
- uses: r-lib/actions/[email protected]
7560
with:
76-
path: ${{ env.R_LIBS_USER }}
77-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
78-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
79-
80-
- name: Install dependencies
81-
run: |
82-
Sys.setenv("MAKEFLAGS"="-j2")
83-
remotes::install_deps(dependencies = TRUE)
84-
remotes::install_cran("rcmdcheck")
85-
remotes::install_local(path = ".")
86-
install.packages("curl")
87-
shell: Rscript {0}
61+
extra-packages: any::rcmdcheck, local::.
8862

8963
- name: Install cmdstan
9064
run: |
@@ -99,11 +73,9 @@ jobs:
9973
sessioninfo::session_info(pkgs, include_base = TRUE)
10074
shell: Rscript {0}
10175

102-
- name: Check
76+
- uses: r-lib/actions/[email protected]
10377
env:
10478
_R_CHECK_CRAN_INCOMING_: false
105-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
106-
shell: Rscript {0}
10779

10880
- name: Show testthat output
10981
if: always()

.github/workflows/Test-coverage.yaml

Lines changed: 17 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ name: Test coverage
1313
- master
1414

1515
jobs:
16-
test-coverage-ubuntu:
17-
name: "Linux"
16+
test-coverage:
1817
if: "! contains(github.event.head_commit.message, '[ci skip]')"
19-
runs-on: ubuntu-20.04
18+
runs-on: ${{ matrix.config.os }}
19+
20+
name: ${{ matrix.config.os }}
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
config:
26+
- { os: windows-latest }
27+
- { os: ubuntu-latest }
2028
env:
2129
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2230
NOT_CRAN: true
@@ -37,76 +45,23 @@ jobs:
3745
- uses: r-lib/actions/[email protected]
3846
- uses: r-lib/actions/[email protected]
3947

40-
- name: Install Ubuntu dependencies
41-
run: |
42-
sudo apt-get update
43-
sudo apt-get install -y libcurl4-openssl-dev
44-
sudo apt-get install -y openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
45-
46-
- name: Query dependencies
47-
run: |
48-
install.packages('remotes')
49-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
50-
shell: Rscript {0}
51-
52-
- name: Cache R packages
53-
uses: actions/cache@v4
48+
- uses: r-lib/actions/[email protected]
5449
with:
55-
path: ${{ env.R_LIBS_USER }}
56-
key: ubuntu-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ubuntu-r-4.0-1-
58-
59-
- name: Install dependencies
60-
run: |
61-
install.packages(c("remotes", "curl"), dependencies = TRUE)
62-
remotes::install_local(path = ".", INSTALL_opts = "--no-test-load")
63-
remotes::install_deps(dependencies = TRUE)
64-
remotes::install_cran("covr")
65-
remotes::install_cran("gridExtra")
66-
shell: Rscript {0}
50+
extra-packages: any::rcmdcheck, local::., any::covr, any::gridExtra
6751

6852
- name: Install cmdstan
6953
run: |
7054
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
7155
cmdstanr::install_cmdstan(cores = 2)
7256
shell: Rscript {0}
7357

74-
- name: Test coverage
58+
- name: Test coverage (Linux)
59+
if: runner.os == 'Linux'
7560
run: covr::codecov(type = "tests")
7661
shell: Rscript {0}
7762

78-
test-coverage-windows:
79-
name: "Windows"
80-
if: "! contains(github.event.head_commit.message, '[ci skip]')"
81-
runs-on: windows-latest
82-
env:
83-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
84-
NOT_CRAN: true
85-
steps:
86-
- uses: actions/checkout@v4
87-
88-
- uses: r-lib/actions/[email protected]
89-
90-
- uses: r-lib/actions/[email protected]
91-
92-
- name: Query dependencies
93-
run: |
94-
install.packages('remotes')
95-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
96-
shell: Rscript {0}
97-
98-
- name: Install dependencies
99-
run: |
100-
install.packages(c("remotes", "curl"), dependencies = TRUE)
101-
remotes::install_local(path = ".")
102-
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
103-
cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)
104-
remotes::install_deps(dependencies = TRUE)
105-
remotes::install_cran("covr")
106-
remotes::install_cran("gridExtra")
107-
shell: Rscript {0}
108-
109-
- name: Test coverage
63+
- name: Test coverage (Windows)
64+
if: runner.os == 'Windows'
11065
run: |
11166
options(covr.gcov = 'C:/rtools40/mingw64/bin/gcov.exe');
11267
covr::codecov(type = "tests", function_exclusions = "sample_mpi")

tests/testthat/test-install.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ test_that("install_cmdstan() works with version and release_url", {
9898
expect_message(
9999
expect_output(
100100
install_cmdstan(dir = dir, overwrite = TRUE, cores = 4,
101-
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.26.1/cmdstan-2.26.1.tar.gz",
101+
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.33.0/cmdstan-2.33.0.tar.gz",
102102
wsl = os_is_wsl()),
103103
"Compiling, linking C++ code",
104104
fixed = TRUE
@@ -110,7 +110,7 @@ test_that("install_cmdstan() works with version and release_url", {
110110
expect_message(
111111
expect_output(
112112
install_cmdstan(dir = dir, overwrite = TRUE, cores = 4,
113-
version = "2.27.0",
113+
version = "2.33.0",
114114
# the URL is intentionally invalid to test that the version has higher priority
115115
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.27.3/cmdstan-2.27.3.tar.gz",
116116
wsl = os_is_wsl()),
@@ -123,7 +123,7 @@ test_that("install_cmdstan() works with version and release_url", {
123123
"version and release_url shouldn't both be specified",
124124
fixed = TRUE
125125
)
126-
expect_true(dir.exists(file.path(dir, "cmdstan-2.27.0")))
126+
expect_true(dir.exists(file.path(dir, "cmdstan-2.33.0")))
127127
set_cmdstan_path(cmdstan_default_path())
128128
})
129129

0 commit comments

Comments
 (0)