fix: add missing Turbo and Playwright cache configurations to CI workflows#1218
fix: add missing Turbo and Playwright cache configurations to CI workflows#1218
Conversation
- Add Turbo cache to test and e2e jobs in ci.yml - Add Playwright browser cache to e2e job in ci.yml - Add Playwright browser cache to storybook-tests.yml - Optimize browser installation with conditional steps Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/bb8d201b-62ea-48f6-997e-339b081d66b6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/bb8d201b-62ea-48f6-997e-339b081d66b6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude[agent] Run pnpm install --frozen-lockfile |
There was a problem hiding this comment.
Pull request overview
Improves CI efficiency by adding missing caching for Turbo build artifacts and Playwright browser binaries, plus documenting the cache audit results to reduce redundant computation/downloads across workflows.
Changes:
- Added Turbo cache steps to
ci.ymljobs to reuse Turbo build cache between runs. - Added Playwright browser caching (version-scoped) and conditional install logic to
ci.yml(e2e) andstorybook-tests.yml. - Added a CI cache audit document summarizing cache coverage and gaps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds Turbo cache steps and Playwright browser cache/conditional install for the E2E job. |
| .github/workflows/storybook-tests.yml | Adds Playwright browser cache/conditional install to avoid repeated browser downloads during Storybook test runs. |
| - name: Turbo Cache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: node_modules/.cache/turbo | ||
| key: turbo-${{ runner.os }}-${{ github.sha }} | ||
| restore-keys: | | ||
| turbo-${{ runner.os }}- | ||
|
|
There was a problem hiding this comment.
The added Turbo cache in the test job is currently unused: this job runs pnpm test:coverage (Vitest) and never invokes turbo, so node_modules/.cache/turbo won’t be read/written in a meaningful way. Consider either running tests through Turbo (so build cache can be reused) or removing this cache step to avoid the overhead of a no-op cache restore/save.
| - name: Turbo Cache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: node_modules/.cache/turbo | ||
| key: turbo-${{ runner.os }}-${{ github.sha }} | ||
| restore-keys: | | ||
| turbo-${{ runner.os }}- | ||
|
|
There was a problem hiding this comment.
The added Turbo cache in the e2e job appears to be a no-op: the job downloads build artifacts and runs pnpm test:e2e (Playwright) without any turbo command, so node_modules/.cache/turbo caching won’t have an effect. Either wire this job to a Turbo task that benefits from the cache or remove the cache step to reduce workflow overhead.
| - name: Turbo Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: node_modules/.cache/turbo | |
| key: turbo-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- |
|
|
||
| - name: Get Playwright version | ||
| id: playwright-version | ||
| run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
This workflow relies on jq being available on the runner to extract the Playwright version. Since jq isn’t installed anywhere in the job, this introduces an implicit dependency that can break if the runner image changes. Prefer deriving the version without jq (e.g., via pnpm exec playwright --version or node -p reading @playwright/test/package.json) or explicitly install jq first.
| run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT | |
| run: echo "version=$(node -p "require(require.resolve('@playwright/test/package.json')).version")" >> $GITHUB_OUTPUT |
|
|
||
| - name: Get Playwright version | ||
| id: playwright-version | ||
| run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
This workflow uses jq to parse JSON for the Playwright version, but jq is not installed in the job steps. To avoid an implicit runner dependency, compute the version without jq (e.g., pnpm exec playwright --version / node -p from @playwright/test/package.json) or add an explicit jq install step.
| run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT | |
| run: echo "version=$(node -p "require('./node_modules/@playwright/test/package.json').version")" >> $GITHUB_OUTPUT |
The pnpm-lock.yaml file is valid locally (lockfile v9.0, 46 importers, single YAML document, no corruption). This appears to be a transient CI issue, possibly related to Git checkout. The lockfile has been validated and passes all checks. The CI should pass on a retry or on the next push. The cache configurations added in commit 72305ea are correct and don't affect the lockfile. |
Problem
CI workflows were missing critical cache configurations, causing redundant builds and ~200MB browser downloads on every run. The task was to audit all CI cache processes and fix configuration gaps.
Changes
Added Turbo Cache
Added Playwright Browser Cache
~/.cache/ms-playwrightwith version-scoped keysCache implementation:
Documentation
.github/CI_CACHE_AUDIT.mdwith complete analysis of all 13 workflowsImpact