Skip to content

Commit 3da8fa7

Browse files
krlmlrclaude
andauthored
ci: Create ~/.duckdb and set DUCKDB_R_HOME for the duckdb tests (#2487)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent fb99e85 commit 3da8fa7

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/custom/before-install/action.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,34 @@ runs:
5555
run: |
5656
brew install unixodbc
5757
shell: bash
58+
59+
# The duckdb test source connects with a bare `duckdb::duckdb()`,
60+
# which leaves it to the package to pick where downloaded extensions
61+
# and stored secrets live.
62+
# Whenever the package picks by itself it announces the location:
63+
# a missing `~/.duckdb` draws the long "temporary directory" notice,
64+
# and a bare `~/.duckdb` still draws a shorter "storing under ~/.duckdb" one
65+
# (see `?duckdb_storage`).
66+
# Both are noise in CI, and both can leak into test output.
67+
#
68+
# So create the shared home -- the same directory the duckdb repo creates in
69+
# its own CI -- and additionally point `DUCKDB_R_HOME` at it.
70+
# The environment variable counts as an explicit choice,
71+
# so duckdb resolves to that directory without announcing anything,
72+
# while the directory itself keeps extensions in one place for the whole run.
73+
# duckdb derives the home from `USERPROFILE` on Windows and `HOME` elsewhere,
74+
# so match that here rather than relying on shell `~` expansion.
75+
- name: Create the shared DuckDB home (~/.duckdb)
76+
run: |
77+
if [ "${RUNNER_OS}" = "Windows" ]; then
78+
home="$(cygpath -u "${USERPROFILE}")"
79+
else
80+
home="${HOME}"
81+
fi
82+
mkdir -p "${home}/.duckdb"
83+
duckdb_home="${home}/.duckdb"
84+
if [ "${RUNNER_OS}" = "Windows" ]; then
85+
duckdb_home="$(cygpath -w "${duckdb_home}")"
86+
fi
87+
echo "DUCKDB_R_HOME=${duckdb_home}" | tee -a "$GITHUB_ENV"
88+
shell: bash

0 commit comments

Comments
 (0)