Skip to content

Commit 1fe2ef9

Browse files
committed
Use non-GH specific env vars
GITHUB_WORKSPACE -> R_APP_WORKSPACE, RUNNER_TEMP -> R_APP_TEMP
1 parent 30202ac commit 1fe2ef9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

R/paths.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repo_root <- function() {
2-
file.path(Sys.getenv("GITHUB_WORKSPACE", "www"))
2+
file.path(Sys.getenv("R_APP_WORKSPACE", "www"))
33
}
44

55
cache_dir <- function() {
6-
file.path(Sys.getenv("RUNNER_TEMP", "cache"))
6+
file.path(Sys.getenv("R_APP_TEMP", "cache"))
77
}

tests/testthat/test-parse.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ test_that("parse_package_list", {
1616
})
1717

1818
test_that("parse_metadata_file", {
19-
withr::local_envvar(GITHUB_WORKSPACE = test_path("fixtures"))
19+
withr::local_envvar(R_APP_WORKSPACE = test_path("fixtures"))
2020
expect_snapshot({
2121
parse_metadata_file("src/contrib")
2222
})
2323

24-
withr::local_envvar(GITHUB_WORKSPACE = tempfile())
24+
withr::local_envvar(R_APP_WORKSPACE = tempfile())
2525
expect_snapshot({
2626
parse_metadata_file("src/contrib")
2727
}, transform = redact_tempfile)
2828
})
2929

3030
test_that("get_state", {
3131
withr::local_envvar(TEST_CRAN_PACKAGE_MIRROR = fake_cran$url())
32-
withr::local_envvar(GITHUB_WORKSPACE = test_path("fixtures"))
32+
withr::local_envvar(R_APP_WORKSPACE = test_path("fixtures"))
3333
expect_snapshot({
3434
get_state("src/contrib")
3535
}, transform = redact_webfakes)

tests/testthat/test-update.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ test_that("update_dir", {
2121
withr::local_options(cli.dynamic = FALSE, cli.ansi = FALSE)
2222

2323
withr::local_envvar(TEST_CRAN_PACKAGE_MIRROR = fake_cran$url())
24-
withr::local_envvar(GITHUB_WORKSPACE = test_path("fixtures"))
25-
withr::local_envvar(RUNNER_TEMP = file.path(tmp, "cache"))
24+
withr::local_envvar(R_APP_WORKSPACE = test_path("fixtures"))
25+
withr::local_envvar(R_APP_TEMP = file.path(tmp, "cache"))
2626

2727
# create a local METADATA2.gz file that is outdated
2828
meta <- suppressMessages(parse_metadata_file("src/contrib"))
2929
meta_upd <- rbind(meta, c("test_0.0.0.1.tar.gz", 1, NA, "", NA, ""))
30-
withr::local_envvar(GITHUB_WORKSPACE = tmp)
30+
withr::local_envvar(R_APP_WORKSPACE = tmp)
3131
write_metadata("src/contrib", meta_upd)
3232

3333
expect_snapshot({

0 commit comments

Comments
 (0)