Skip to content

Commit c9a13a0

Browse files
authored
Some R package upkeep (#77)
* Add GitHub links to DESCRIPTION * Update lifecycle SVGs * Update README * Update lifecycle, testthat * Redocument * Switch to native pipe * Update Posit as funder * Change headers in vignette * Apply air to package * Add Air config * Update date in LICENSE * Update DESCRIPTION * Update GH actions * Update this one too * Fix up package level description * Take very old versions of R back out of GH actions
1 parent 31d774e commit c9a13a0

Some content is hidden

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

52 files changed

+489
-256
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
^CRAN-SUBMISSION$
1414
^\.python-version$
1515
^revdep$
16+
^[.]?air[.]toml$
17+
^\.vscode$

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
# dependency.
99
on:
1010
push:
11-
branches: [main]
11+
branches: main
1212
pull_request:
13-
branches: [main]
1413

1514
name: R-CMD-check-hard
1615

16+
permissions: read-all
17+
1718
jobs:
1819
R-CMD-check:
1920
runs-on: ${{ matrix.config.os }}

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ on:
88
push:
99
branches: main
1010
pull_request:
11-
branches: main
1211

1312
name: R-CMD-check
1413

14+
permissions: read-all
15+
1516
jobs:
1617
R-CMD-check:
1718
runs-on: ${{ matrix.config.os }}
@@ -26,10 +27,10 @@ jobs:
2627

2728
- {os: windows-latest, r: 'release'}
2829

29-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
30-
- {os: ubuntu-latest, r: 'release'}
31-
- {os: ubuntu-latest, r: 'oldrel-1'}
32-
- {os: ubuntu-latest, r: 'oldrel-2'}
30+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
31+
- {os: ubuntu-latest, r: 'release'}
32+
- {os: ubuntu-latest, r: 'oldrel-1'}
33+
- {os: ubuntu-latest, r: 'oldrel-2'}
3334

3435
env:
3536
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -70,3 +71,4 @@ jobs:
7071
- uses: r-lib/actions/check-r-package@v2
7172
with:
7273
upload-snapshots: true
74+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
2+
3+
on:
4+
# Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
5+
# privileges, otherwise we can't set `pull-requests: write` when the pull
6+
# request comes from a fork, which is our main use case (external contributors).
7+
#
8+
# `pull_request_target` runs in the context of the target branch (`main`, usually),
9+
# rather than in the context of the pull request like `pull_request` does. Due
10+
# to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
11+
# This is typically frowned upon by GitHub, as it exposes you to potentially running
12+
# untrusted code in a context where you have elevated privileges, but they explicitly
13+
# call out the use case of reformatting and committing back / commenting on the PR
14+
# as a situation that should be safe (because we aren't actually running the untrusted
15+
# code, we are just treating it as passive data).
16+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
17+
pull_request_target:
18+
19+
name: format-suggest.yaml
20+
21+
jobs:
22+
format-suggest:
23+
name: format-suggest
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
# Required to push suggestion comments to the PR
28+
pull-requests: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
35+
- name: Install
36+
uses: posit-dev/setup-air@v1
37+
38+
- name: Format
39+
run: air format .
40+
41+
- name: Suggest
42+
uses: reviewdog/action-suggester@v1
43+
with:
44+
level: error
45+
fail_level: error
46+
tool_name: air

.github/workflows/pkgdown.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: main
66
pull_request:
7-
branches: [main, master]
87
release:
98
types: [published]
109
workflow_dispatch:
1110

1211
name: pkgdown
1312

13+
permissions: read-all
14+
1415
jobs:
1516
pkgdown:
1617
runs-on: ubuntu-latest
@@ -57,7 +58,7 @@ jobs:
5758

5859
- name: Deploy to GitHub pages 🚀
5960
if: github.event_name != 'pull_request'
60-
uses: JamesIves/github-pages-deploy-action@v4.4.1
61+
uses: JamesIves/github-pages-deploy-action@v4.5.0
6162
with:
6263
clean: false
6364
branch: gh-pages

.github/workflows/test-coverage.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: main
66
pull_request:
7-
branches: main
87

98
name: test-coverage
109

@@ -51,9 +50,19 @@ jobs:
5150
clean = FALSE,
5251
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
5352
)
53+
print(cov)
5454
covr::to_cobertura(cov)
5555
shell: Rscript {0}
5656

57+
- uses: codecov/codecov-action@v5
58+
with:
59+
# Fail if error if not on PR, or if on PR and token is given
60+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
61+
files: ./cobertura.xml
62+
plugins: noop
63+
disable_search: true
64+
token: ${{ secrets.CODECOV_TOKEN }}
65+
5766
- name: Show testthat output
5867
if: always()
5968
run: |
@@ -67,4 +76,3 @@ jobs:
6776
with:
6877
name: coverage-test-failures
6978
path: ${{ runner.temp }}/package
70-

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"Posit.air-vscode"
4+
]
5+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[r]": {
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "Posit.air-vscode"
5+
},
6+
"[quarto]": {
7+
"editor.formatOnSave": true,
8+
"editor.defaultFormatter": "quarto.quarto"
9+
}
10+
}

DESCRIPTION

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Authors@R: c(
77
person("Simon", "Couch", , "simonpatrickcouch@gmail.com", role = "aut"),
88
person("Qiushi", "Yan", , "qiushi.yann@gmail.com", role = "aut"),
99
person("Max", "Kuhn", , "max@posit.co", role = "aut"),
10-
person("Posit Software, PBC", role = c("cph", "fnd"))
10+
person("Posit Software, PBC", role = c("cph", "fnd"),
11+
comment = c(ROR = "03wc8by49"))
1112
)
1213
Description: Typically, models in 'R' exist in memory and can be saved via
1314
regular 'R' serialization. However, some models store information in
@@ -19,9 +20,10 @@ License: MIT + file LICENSE
1920
URL: https://github.com/rstudio/bundle, https://rstudio.github.io/bundle/
2021
BugReports: https://github.com/rstudio/bundle/issues
2122
Depends:
22-
R (>= 3.6)
23+
R (>= 4.1)
2324
Imports:
2425
glue,
26+
lifecycle,
2527
purrr,
2628
rlang,
2729
utils,
@@ -56,10 +58,11 @@ Suggests:
5658
xgboost (>= 1.6.0.1)
5759
VignetteBuilder:
5860
knitr
61+
Remotes:
62+
tidymodels/butcher
5963
Config/Needs/website: tidyverse/tidytemplate
6064
Config/testthat/edition: 3
65+
Config/usethis/last-upkeep: 2025-12-08
6166
Encoding: UTF-8
6267
Roxygen: list(markdown = TRUE)
63-
RoxygenNote: 7.3.2
64-
Remotes:
65-
tidymodels/butcher
68+
RoxygenNote: 7.3.3

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2023
1+
YEAR: 2025
22
COPYRIGHT HOLDER: bundle authors

0 commit comments

Comments
 (0)