mirror of https://github.com/garrytan/gstack.git
fix: set TMPDIR=/tmp + XDG_CACHE_HOME in CI
GH Actions ignores HOME overrides in container options. Set TMPDIR=/tmp (the tmpfs mount) and XDG_CACHE_HOME=/tmp/.cache so bun and Playwright use the writable tmpfs for all temp/cache operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9ab90a2778
commit
6ce3e7be3b
|
|
@ -62,7 +62,7 @@ jobs:
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
options: --tmpfs /tmp:exec -e HOME=/home/runner
|
options: --tmpfs /tmp:exec
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
@ -98,13 +98,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# Bun needs a writable tmpdir — GH Actions container maps HOME=/github/home
|
# Bun needs a writable tmpdir — set to /tmp which is a tmpfs mount
|
||||||
# and the runner user can't write to the default /tmp in some container configs.
|
|
||||||
- name: Fix temp dirs
|
- name: Fix temp dirs
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "$HOME/tmp"
|
echo "TMPDIR=/tmp" >> "$GITHUB_ENV"
|
||||||
echo "TMPDIR=$HOME/tmp" >> "$GITHUB_ENV"
|
echo "BUN_TMPDIR=/tmp" >> "$GITHUB_ENV"
|
||||||
echo "BUN_TMPDIR=$HOME/tmp" >> "$GITHUB_ENV"
|
echo "XDG_CACHE_HOME=/tmp/.cache" >> "$GITHUB_ENV"
|
||||||
|
mkdir -p /tmp/.cache
|
||||||
|
|
||||||
# Restore pre-installed node_modules from Docker image via symlink (~0s vs ~15s install)
|
# Restore pre-installed node_modules from Docker image via symlink (~0s vs ~15s install)
|
||||||
# If package.json changed since image was built, fall back to fresh install
|
# If package.json changed since image was built, fall back to fresh install
|
||||||
|
|
@ -123,10 +123,8 @@ jobs:
|
||||||
- name: Verify Chromium
|
- name: Verify Chromium
|
||||||
if: matrix.suite.name == 'e2e-browse'
|
if: matrix.suite.name == 'e2e-browse'
|
||||||
run: |
|
run: |
|
||||||
# shellcheck disable=SC2012
|
|
||||||
echo "whoami=$(whoami) HOME=$HOME TMPDIR=${TMPDIR:-unset}"
|
echo "whoami=$(whoami) HOME=$HOME TMPDIR=${TMPDIR:-unset}"
|
||||||
stat /tmp
|
touch /tmp/.bun-test && rm /tmp/.bun-test && echo "/tmp writable"
|
||||||
touch /tmp/.bun-write-test && rm /tmp/.bun-write-test && echo "/tmp writable"
|
|
||||||
bun -e "import {chromium} from 'playwright';const b=await chromium.launch({args:['--no-sandbox']});console.log('Chromium OK');await b.close()"
|
bun -e "import {chromium} from 'playwright';const b=await chromium.launch({args:['--no-sandbox']});console.log('Chromium OK');await b.close()"
|
||||||
|
|
||||||
- name: Run ${{ matrix.suite.name }}
|
- name: Run ${{ matrix.suite.name }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue