Skip to content

Commit 8fb63d4

Browse files
Merge pull request #197 from tidymodels/make-cmd-check-run
2 parents 0c6d247 + 8cb6e6c commit 8fb63d4

File tree

10 files changed

+80
-36
lines changed

10 files changed

+80
-36
lines changed

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ on:
99
branches: [main, master]
1010
pull_request:
1111
branches: [main, master]
12+
workflow_dispatch:
1213

13-
name: R-CMD-check
14+
name: R-CMD-check.yaml
15+
16+
permissions: read-all
1417

1518
jobs:
1619
R-CMD-check:
@@ -25,21 +28,25 @@ jobs:
2528
- {os: macos-latest, r: 'release'}
2629

2730
- {os: windows-latest, r: 'release'}
28-
# use 4.1 to check with rtools40's older compiler
29-
- {os: windows-latest, r: '4.1'}
31+
# use 4.0 or 4.1 to check with rtools40's older compiler
32+
- {os: windows-latest, r: 'oldrel-4'}
3033

31-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
32-
- {os: ubuntu-latest, r: 'release'}
33-
- {os: ubuntu-latest, r: 'oldrel-1'}
34-
- {os: ubuntu-latest, r: 'oldrel-2'}
35-
- {os: ubuntu-latest, r: 'oldrel-3'}
34+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
35+
- {os: ubuntu-latest, r: 'release'}
36+
- {os: ubuntu-latest, r: 'oldrel-1'}
37+
- {os: ubuntu-latest, r: 'oldrel-2'}
38+
- {os: ubuntu-latest, r: 'oldrel-3'}
39+
#- {os: ubuntu-latest, r: 'oldrel-4'}
3640

3741
env:
3842
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3943
R_KEEP_PKG_SOURCE: yes
44+
CXX14: g++
45+
CXX14STD: -std=c++1y
46+
CXX14FLAGS: -Wall -g -02
4047

4148
steps:
42-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
4350

4451
- uses: r-lib/actions/setup-pandoc@v2
4552

@@ -57,3 +64,8 @@ jobs:
5764
- uses: r-lib/actions/check-r-package@v2
5865
with:
5966
upload-snapshots: true
67+
68+
- name: Show testthat output
69+
if: always()
70+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
71+
shell: bash

.github/workflows/pkgdown.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
types: [published]
1010
workflow_dispatch:
1111

12-
name: pkgdown
12+
name: pkgdown.yaml
13+
14+
permissions: read-all
1315

1416
jobs:
1517
pkgdown:
@@ -19,8 +21,10 @@ jobs:
1921
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2022
env:
2123
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
2226
steps:
23-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2428

2529
- uses: r-lib/actions/setup-pandoc@v2
2630

@@ -39,7 +43,7 @@ jobs:
3943

4044
- name: Deploy to GitHub pages 🚀
4145
if: github.event_name != 'pull_request'
42-
uses: JamesIves/github-pages-deploy-action@v4.4.1
46+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4347
with:
4448
clean: false
4549
branch: gh-pages

.github/workflows/pr-commands.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
issue_comment:
55
types: [created]
66

7-
name: Commands
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
810

911
jobs:
1012
document:
@@ -13,8 +15,10 @@ jobs:
1315
runs-on: ubuntu-latest
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
1620
steps:
17-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1822

1923
- uses: r-lib/actions/pr-fetch@v2
2024
with:
@@ -50,8 +54,10 @@ jobs:
5054
runs-on: ubuntu-latest
5155
env:
5256
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
5359
steps:
54-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
5561

5662
- uses: r-lib/actions/pr-fetch@v2
5763
with:

.github/workflows/test-coverage.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
test-coverage:
@@ -15,36 +17,45 @@ jobs:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618

1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921

2022
- uses: r-lib/actions/setup-r@v2
2123
with:
2224
use-public-rspm: true
2325

2426
- uses: r-lib/actions/setup-r-dependencies@v2
2527
with:
26-
extra-packages: any::covr
28+
extra-packages: any::covr, any::xml2
2729
needs: coverage
2830

2931
- name: Test coverage
3032
run: |
31-
covr::codecov(
33+
cov <- covr::package_coverage(
3234
quiet = FALSE,
3335
clean = FALSE,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3537
)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v4
42+
with:
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
3849
- name: Show testthat output
3950
if: always()
4051
run: |
4152
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4354
shell: bash
4455

4556
- name: Upload test results
4657
if: failure()
47-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
4859
with:
4960
name: coverage-test-failures
5061
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Imports:
2424
generics (>= 0.1.2),
2525
glue (>= 1.6.2),
2626
hardhat (>= 1.0.0),
27-
modelenv (>= 0.1.0),
27+
modelenv (>= 0.2.0.9000),
2828
parsnip (>= 1.0.2),
2929
prettyunits (>= 1.1.0),
30-
Rfast (>= 2.0.6),
30+
Rfast (>= 2.0.6),
3131
rlang (>= 1.0.6),
3232
rsample (>= 1.0.0),
3333
stats,
@@ -49,6 +49,8 @@ Suggests:
4949
rmarkdown,
5050
testthat (>= 3.0.0),
5151
workflows (>= 1.1.2)
52+
Remotes:
53+
tidymodels/modelenv
5254
Config/Needs/website: pkgdown, tidymodels, tidyverse, palmerpenguins,
5355
patchwork, ggforce, tidyverse/tidytemplate
5456
Config/testthat/edition: 3

R/cluster_spec.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
#' @export
1111
#' @keywords internal
1212
new_cluster_spec <- function(cls, args, eng_args, mode, method, engine) {
13-
modelenv::check_spec_mode_engine_val(model = cls, mode = mode, eng = engine)
13+
modelenv::check_spec_mode_engine_val(
14+
model = cls,
15+
mode = mode,
16+
eng = engine,
17+
call = rlang::caller_env()
18+
)
1419

1520
out <- list(
1621
args = args, eng_args = eng_args,

tests/testthat/_snaps/arguments.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,30 @@
1212
k_means() %>% set_mode()
1313
Condition
1414
Error in `modelenv::stop_incompatible_mode()`:
15-
! Available modes for model type k_means are: 'unknown', 'partition'
15+
x Available modes for model type k_means are:
16+
* "unknown" and "partition".
1617

1718
---
1819

1920
Code
2021
k_means() %>% set_mode(2)
2122
Condition
22-
Error in `modelenv::check_spec_mode_engine_val()`:
23-
! '2' is not a known mode for model `k_means()`.
23+
Error in `set_mode()`:
24+
! 2 is not a known mode for model `k_means()`.
2425

2526
---
2627

2728
Code
2829
k_means() %>% set_mode("haberdashery")
2930
Condition
30-
Error in `modelenv::check_spec_mode_engine_val()`:
31-
! 'haberdashery' is not a known mode for model `k_means()`.
31+
Error in `set_mode()`:
32+
! "haberdashery" is not a known mode for model `k_means()`.
3233

3334
# can't set a mode that isn't allowed by the model spec
3435

3536
Code
3637
set_mode(k_means(), "classification")
3738
Condition
38-
Error in `modelenv::check_spec_mode_engine_val()`:
39-
! 'classification' is not a known mode for model `k_means()`.
39+
Error in `set_mode()`:
40+
! "classification" is not a known mode for model `k_means()`.
4041

tests/testthat/_snaps/hier_clust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Code
44
hier_clust(mode = "bogus")
55
Condition
6-
Error in `modelenv::check_spec_mode_engine_val()`:
7-
! 'bogus' is not a known mode for model `hier_clust()`.
6+
Error in `hier_clust()`:
7+
! "bogus" is not a known mode for model `hier_clust()`.
88

99
---
1010

tests/testthat/_snaps/k_means.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Code
44
k_means(mode = "bogus")
55
Condition
6-
Error in `modelenv::check_spec_mode_engine_val()`:
7-
! 'bogus' is not a known mode for model `k_means()`.
6+
Error in `k_means()`:
7+
! "bogus" is not a known mode for model `k_means()`.
88

99
---
1010

tests/testthat/_snaps/tune_cluster.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112
Condition
113113
Warning:
114114
The `...` are not used in this function but one or more objects were passed: 'something'
115+
Warning:
116+
`grid_latin_hypercube()` was deprecated in dials 1.3.0.
117+
i Please use `grid_space_filling()` instead.
115118
Output
116119
# Tuning results
117120
# 2-fold cross-validation

0 commit comments

Comments
 (0)