fix(ci): improve cache strategy and resilience for all GitHub Actions workflows#1906
Conversation
…rome install, add resilience Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/96326a48-0343-476f-bcc1-db1abda8d0a8 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/96326a48-0343-476f-bcc1-db1abda8d0a8 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned Files
|
There was a problem hiding this comment.
Pull request overview
This pull request updates CI workflows to reduce redundant caching, standardize cache key versioning, and harden package/browser installation steps against external registry/network failures across GitHub Actions workflows.
Changes:
- Removed redundant explicit
~/.npmcaches whereactions/setup-nodealready provides npm caching. - Standardized explicit
actions/cacheusage (pinned SHA) and introducedv2-cache key prefixing for cache invalidation. - Added resilience improvements for apt/Chrome/Playwright installation (noninteractive apt, retries, and step timeouts) and documented the strategy in
WORKFLOWS.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| WORKFLOWS.md | Documents the new cache strategy and resilience measures for CI workflows. |
| .github/workflows/test-and-report.yml | Removes redundant npm cache; versions cache keys; adds apt/Chrome install hardening and timeouts. |
| .github/workflows/screenshot-analysis.yml | Versions cache keys; adds apt/playwright install timeouts and noninteractive apt usage. |
| .github/workflows/release.yml | Versions cache keys; removes redundant npm cache; modernizes Chrome install with retries and adds timeouts. |
| .github/workflows/codeql.yml | Removes redundant explicit ~/.npm cache step in favor of setup-node caching. |
| .github/workflows/audit-assets.yml | Removes redundant explicit ~/.npm cache step in favor of setup-node caching. |
| - name: Cache Vite build cache | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: node_modules/.vite | ||
| key: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json') }} | ||
| key: v2-${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-vite- | ||
| v2-${{ runner.os }}-vite- | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
| - name: Cache Vite build cache | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: node_modules/.vite | ||
| key: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json') }} | ||
| key: v2-${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-vite- | ||
| v2-${{ runner.os }}-vite- | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
| Explicit `actions/cache` steps are used **only** for build artifacts that `setup-node` does not cover: | ||
|
|
||
| | Cache | Path | Key pattern | Used in | | ||
| |---|---|---|---| | ||
| | Vite build cache | `node_modules/.vite` | `v2-{OS}-vite-{lockfile-hash}` | build-validation, release build | |
|
@copilot apply changes based on the comments in this thread |
…modules wipe Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/b3e1f7cd-4a0d-4305-8513-bbf7d2535e85 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Fixed in 76d239e. The Vite cache restore step is now placed after |
|
@copilot analyse and fix failing workflow, improve correct code, test, workflow. root cause failing checks |
…-miss downloads Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/b4ee4d1c-28b8-4da7-8ff7-bd00848758bb Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Root cause identified and fixed in 80a0c04. The Fix: Increased the timeout from |
~/.npmcaches (setup-node handles npm caching)v2-prefix to expire existing cachesapt-key addwith moderngpg --dearmormethodDEBIAN_FRONTEND=noninteractive, retry flags,timeout-minuteson install stepsnpm ciso the cached.vitedir is not wiped bynode_modulesdeletion (test-and-report.yml, release.yml)