You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ccc1cf6
Browse filesBrowse the repository at this point in the historyBrowse files
Replace renv with a rig project for the R test environment
Setting up the test R environment in several worktrees at once could
hang for tens of minutes: concurrent cold renv::restore() runs sharing
one renv cache stalled for over 28 minutes, and every R started under
tests/ paid for the renv autoloader. The tests/ R environment is now a
rig project, so rig proj sync installs packages from a lock file without
running R or renv's shared lock.
- Replace DESCRIPTION, renv.lock and renv/ with tests/rproj.toml and
tests/rproj.lock, solved for Windows, macOS arm64, Linux x86_64 and
source
- Point QUARTO_R at tests/.rvenv/bin in run-tests and drop the
per-fixture .Rprofile that activated renv
- Make configure-test-env run rig proj sync, then install dev rmarkdown
and knitr into the project library
- Install a pinned rig in CI and sync with --locked so a stale lock
fails the job; remove the renv cache and renv::status() steps
Copy file name to clipboardExpand all lines: .github/workflows/test-ff-matrix.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ on:
4
4
workflow_call:
5
5
inputs:
6
6
extra-r-packages:
7
-
description: "Comma-separated R packages to pass to renv::install"
7
+
description: "Comma-separated R packages to pass to rig pkg install (see test-smokes.yml)"
8
8
required: false
9
9
type: string
10
10
default: ""
@@ -46,7 +46,7 @@ on:
46
46
workflow_dispatch:
47
47
inputs:
48
48
extra-r-packages:
49
-
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
49
+
description: "extra R packages installed on top of tests/rproj.lock (like a dev version of one of the deps) - comma separated, passed to rig pkg install: pkg, owner/repo[@ref], gitlab::group/project, url::https://...; pkg@1.2.3 means exactly 1.2.3"
Copy file name to clipboardExpand all lines: .github/workflows/test-smokes-parallel.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ on:
10
10
default: 10
11
11
type: number
12
12
extra-r-packages:
13
-
description: "extra R package to install for the tests runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
13
+
description: "extra R packages installed on top of tests/rproj.lock (like a dev version of one of the deps) - comma separated, passed to rig pkg install: pkg, owner/repo[@ref], gitlab::group/project, url::https://...; pkg@1.2.3 means exactly 1.2.3"
Copy file name to clipboardExpand all lines: .github/workflows/test-smokes.yml
+77-85Lines changed: 77 additions & 85 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ on:
15
15
type: boolean
16
16
default: false
17
17
extra-r-packages:
18
-
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
18
+
description: "extra R packages installed on top of tests/rproj.lock (like a dev version of one of the deps) - comma separated, passed to rig pkg install: pkg, owner/repo[@ref], gitlab::group/project, url::https://...; pkg@1.2.3 means exactly 1.2.3"
19
19
required: false
20
20
type: string
21
21
default: ""
@@ -67,7 +67,7 @@ on:
67
67
type: boolean
68
68
default: false
69
69
extra-r-packages:
70
-
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
70
+
description: "extra R packages installed on top of tests/rproj.lock (like a dev version of one of the deps) - comma separated, passed to rig pkg install: pkg, owner/repo[@ref], gitlab::group/project, url::https://...; pkg@1.2.3 means exactly 1.2.3"
71
71
required: false
72
72
type: string
73
73
default: ""
@@ -110,6 +110,16 @@ jobs:
110
110
# Empty keeps the standard checkout behavior.
111
111
ref: ${{ inputs.ref }}
112
112
113
+
- name: Check the ref supports the rig test environment
114
+
shell: bash
115
+
run: |
116
+
for f in tests/rproj.lock .github/actions/setup-rig/action.yml; do
117
+
if [ ! -f "$f" ]; then
118
+
echo "::error::This checkout has no $f. The R test environment needs a ref that uses the rig project (releases before it was introduced are not supported)."
119
+
exit 1
120
+
fi
121
+
done
122
+
113
123
# macOS runners boot with an unresolvable `.local` hostname, so any process
114
124
# resolving its own hostname stalls ~35s (actions/runner-images#14568).
115
125
- name: Set a resolvable hostname (macOS)
@@ -128,7 +138,7 @@ jobs:
128
138
shell: bash
129
139
130
140
# Drops a slow azure.archive.ubuntu.com from the apt mirror list so the job uses
131
-
# archive.ubuntu.com (actions/runner-images#14823): sampled here before setup-r,
141
+
# archive.ubuntu.com (actions/runner-images#14823): sampled here before rig installs R,
132
142
# and after a failed attempt in later apt steps run via $APT_WITH_FALLBACK.
133
143
# Inline, not a local action, because release mode checks out older tags.
Copy file name to clipboardExpand all lines: dev-docs/configuring-test-deps.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,9 +62,7 @@
62
62
63
63
## R
64
64
65
-
- Add the dependencies in `DESCRIPTION` file
66
-
- Run `renv::install(<package>)` to install the dependencies
67
-
- Run `renv::snapshot()` to lock the versions in `renv.lock`
65
+
- Run `rig proj add <package>` from `tests/`: it adds the dependency to `rproj.toml`, locks it in `rproj.lock` and installs it
68
66
69
67
## Julia
70
68
@@ -82,6 +80,5 @@
82
80
83
81
# Updating test dependencies
84
82
85
-
- When `main` updates the test environment (`tests/renv.lock`, `tests/uv.lock`, `tests/Manifest.toml`, or the R / Python / Julia versions in `.github/workflows/test-smokes.yml`), backport the update to the current stable branch (e.g. `v1.10`) while it still receives patch releases, as its own PR (see `checklist-backport-a-pr.md`).
83
+
- When `main` updates the test environment (`tests/rproj.lock`, `tests/uv.lock`, `tests/Manifest.toml`, or the R / Python / Julia versions in `.github/workflows/test-smokes.yml`), backport the update to the current stable branch (e.g. `v1.10`) while it still receives patch releases, as its own PR (see `checklist-backport-a-pr.md`).
86
84
- Patch releases are then tested against the same current R, Python, Julia and package versions users install.
87
-
- CI caches are shared: the R cache key is built from the OS, the R version and the `tests/renv.lock` hash, and any branch can read caches saved on `main`. A stable branch with identical lock files gets cache hits; a diverged one does a slow cold restore on each PR.
0 commit comments