Files
redwoodjs__local-ci/.github/workflows/cache.yml
2026-03-26 03:29:56 +13:00

63 lines
2.5 KiB
YAML

name: Cache Tests
# Exercises the warm node_modules bind-mount on the local (agent-ci) runner.
# Three parallel jobs all run pnpm install simultaneously. Without the warm cache:
# - First run: one job warms node_modules alone, then the other two run in parallel
# - Subsequent runs: all three start in parallel immediately (node_modules already warm)
on:
pull_request_target:
types: [labeled, synchronize]
jobs:
install-a:
if: '!github.event.pull_request.draft && (contains(fromJSON(''["MEMBER", "OWNER", "COLLABORATOR"]''), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, ''safe-to-run''))'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: pnpm/action-setup@v4
with:
version: 10.30.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- run: pnpm install
- run: echo "✅ install-a complete — node_modules present $(ls node_modules | wc -l | tr -d ' ') packages"
install-b:
if: '!github.event.pull_request.draft && (contains(fromJSON(''["MEMBER", "OWNER", "COLLABORATOR"]''), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, ''safe-to-run''))'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: pnpm/action-setup@v4
with:
version: 10.30.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- run: pnpm install
- run: echo "✅ install-b complete — node_modules present $(ls node_modules | wc -l | tr -d ' ') packages"
install-c:
if: '!github.event.pull_request.draft && (contains(fromJSON(''["MEMBER", "OWNER", "COLLABORATOR"]''), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, ''safe-to-run''))'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: pnpm/action-setup@v4
with:
version: 10.30.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- run: pnpm install
- run: echo "✅ install-c complete — node_modules present $(ls node_modules | wc -l | tr -d ' ') packages"