Skip to content

Commit f020b51

Browse files
authored
ci: speed up integration tests with caching (#604)
1 parent 6ae42d3 commit f020b51

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,31 @@ jobs:
5555
node-version: 22
5656
cache: "pnpm"
5757

58+
- name: Cache Playwright browsers
59+
uses: actions/cache@v4
60+
id: playwright-cache
61+
with:
62+
path: ~/Library/Caches/ms-playwright
63+
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
64+
restore-keys: |
65+
playwright-${{ runner.os }}-
66+
67+
- name: Cache Electron binary
68+
uses: actions/cache@v4
69+
with:
70+
path: ~/Library/Caches/electron
71+
key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
72+
restore-keys: |
73+
electron-${{ runner.os }}-
74+
5875
- name: Install dependencies
5976
run: pnpm install --frozen-lockfile
6077

61-
- name: Build electron-trpc
62-
run: pnpm --filter @posthog/electron-trpc build
63-
64-
- name: Build agent
65-
run: pnpm --filter agent build
78+
- name: Build packages
79+
run: |
80+
pnpm --filter @posthog/electron-trpc build &
81+
pnpm --filter agent build &
82+
wait
6683
6784
- name: Build native modules
6885
run: pnpm --filter twig run build-native
@@ -71,6 +88,7 @@ jobs:
7188
run: pnpm --filter twig run package
7289

7390
- name: Install Playwright
91+
if: steps.playwright-cache.outputs.cache-hit != 'true'
7492
run: pnpm --filter twig exec playwright install --with-deps chromium
7593

7694
- name: Run E2E smoke tests

0 commit comments

Comments
 (0)