Skip to content

Commit d80bd9f

Browse files
Plataneclaude
andcommitted
Cache node_modules from build job, restore in e2e
Build job saves node_modules to actions/cache, e2e jobs restore it read-only. Eliminates ~2min npm install per matrix entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 49dcd13 commit d80bd9f

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
node-version: '22'
2525
cache: 'npm'
2626

27+
- name: Cache node_modules for future jobs
28+
uses: actions/cache@v4
29+
with:
30+
path: node_modules
31+
key: node-modules-${{ hashFiles('package-lock.json') }}
32+
2733
- name: Install dependencies
2834
run: npm ci
2935

@@ -85,7 +91,7 @@ jobs:
8591
matrix:
8692
GRAFANA_IMAGE:
8793
- name: grafana-oss
88-
version: "12.4.0"
94+
version: '12.4.0'
8995
QUICKWIT_VERSION: [edge]
9096
steps:
9197
- uses: actions/checkout@v6
@@ -103,10 +109,15 @@ jobs:
103109
uses: actions/setup-node@v6
104110
with:
105111
node-version: '22'
106-
cache: 'npm'
107112

108-
- name: Install e2e dependencies
109-
run: npm install --no-save @grafana/plugin-e2e @playwright/test && npx playwright install --with-deps chromium
113+
- name: Restore node_modules
114+
uses: actions/cache/restore@v4
115+
with:
116+
path: node_modules
117+
key: node-modules-${{ hashFiles('package-lock.json') }}
118+
119+
- name: Install Playwright
120+
run: npx playwright install --with-deps chromium
110121

111122
- name: Start Grafana (${{ matrix.GRAFANA_IMAGE.name }}:${{ matrix.GRAFANA_IMAGE.version }}) + Quickwit (${{ matrix.QUICKWIT_VERSION }})
112123
run: docker compose up -d --build

0 commit comments

Comments
 (0)