Skip to content

Commit

Permalink
Merge pull request #264 from r-lib/upkeep-2024-07
Browse files Browse the repository at this point in the history
Upkeep 2024-07
  • Loading branch information
lionel- authored Jul 30, 2024
2 parents b016a9c + 047cf00 commit 5bbba33
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 132 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -22,19 +24,18 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel-1'}
- {os: ubuntu-20.04, r: 'oldrel-2'}
- {os: ubuntu-20.04, r: 'oldrel-3'}
- {os: ubuntu-20.04, r: 'oldrel-4'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -62,3 +63,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
6 changes: 5 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
Expand All @@ -19,6 +21,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -39,7 +43,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

name: Commands

permissions: read-all

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
Expand All @@ -23,9 +25,37 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
64 changes: 20 additions & 44 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,67 +1,45 @@
Package: withr
Title: Run Code 'With' Temporarily Modified Global State
Version: 3.0.0.9000
Authors@R:
c(person(given = "Jim",
family = "Hester",
role = "aut"),
person(given = "Lionel",
family = "Henry",
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Kirill",
family = "Müller",
role = "aut",
email = "[email protected]"),
person(given = "Kevin",
family = "Ushey",
role = "aut",
email = "[email protected]"),
person(given = "Hadley",
family = "Wickham",
role = "aut",
email = "[email protected]"),
person(given = "Winston",
family = "Chang",
role = "aut"),
person(given = "Jennifer",
family = "Bryan",
role = "ctb"),
person(given = "Richard",
family = "Cotton",
role = "ctb"),
person(given = "Posit Software, PBC",
role = c("cph", "fnd")))
Description: A set of functions to run code 'with' safely and
temporarily modified global state. Many of these functions were
originally a part of the 'devtools' package, this provides a simple
package with limited dependencies to provide access to these
functions.
Authors@R: c(
person("Jim", "Hester", role = "aut"),
person("Lionel", "Henry", , "[email protected]", role = c("aut", "cre")),
person("Kirill", "Müller", , "[email protected]", role = "aut"),
person("Kevin", "Ushey", , "[email protected]", role = "aut"),
person("Hadley", "Wickham", , "[email protected]", role = "aut"),
person("Winston", "Chang", role = "aut"),
person("Jennifer", "Bryan", role = "ctb"),
person("Richard", "Cotton", role = "ctb"),
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Description: A set of functions to run code 'with' safely and temporarily
modified global state. Many of these functions were originally a part
of the 'devtools' package, this provides a simple package with limited
dependencies to provide access to these functions.
License: MIT + file LICENSE
URL: https://withr.r-lib.org,
https://github.com/r-lib/withr#readme
URL: https://withr.r-lib.org, https://github.com/r-lib/withr#readme
BugReports: https://github.com/r-lib/withr/issues
Depends:
R (>= 3.5.0)
Imports:
graphics,
grDevices,
grDevices
Suggests:
callr,
covr,
DBI,
knitr,
lattice,
methods,
rlang,
rmarkdown (>= 2.12),
RSQLite,
testthat (>= 3.0.0)
VignetteBuilder:
knitr
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0.9000
RoxygenNote: 7.3.2
Collate:
'aaa.R'
'collate.R'
Expand Down Expand Up @@ -93,5 +71,3 @@ Collate:
'torture.R'
'utils.R'
'with.R'
Config/testthat/edition: 3
Config/Needs/website: tidyverse/tidytemplate
1 change: 1 addition & 0 deletions R/torture.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @template with
#' @param new `[integer]`\cr run GC every 'step' allocations.
#' @param wait integer; number of allocations to wait before starting GC torture.
#' @inheritParams base::gctorture
#' @inheritParams local_
with_gctorture2 <- with_(gctorture2)
Expand Down
3 changes: 3 additions & 0 deletions R/with.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@
#' }
#' Sys.getenv("WITHR")
"_PACKAGE"

# Enable pkgload to hotpatch `::` in detached namespaces
on_load(`::` <- base::`::`)
32 changes: 24 additions & 8 deletions man/devices.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/with_gctorture2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/with_tempfile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests/testthat/_snaps/defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
Output
```r
``` r
withr::deferred_run()
```
```
## No deferred expressions to run
```
```r
``` r
defer(writeLines('1'))
writeLines('2')
```
Expand All @@ -52,19 +52,19 @@
## 2
```
```r
``` r
defer(writeLines('3'))
```
```r
``` r
writeLines('4')
```
```
## 4
```
```r
``` r
withr::deferred_run()
```
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/helper.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
set_state_inspector(function() {
dir(".")
})

expect_no_output <- function(...) {
testthat::expect_output(..., regexp = NA)
}
Expand Down
Loading

0 comments on commit 5bbba33

Please sign in to comment.