Skip to content

Commit 643b78c

Browse files
committed
fix(e2e): making required action cacheable
1 parent c9da5ca commit 643b78c

1 file changed

Lines changed: 27 additions & 9 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ on:
44
workflow_dispatch:
55
pull_request:
66
types: [opened, reopened, ready_for_review, synchronize]
7-
paths:
8-
- "src/**"
9-
- "webview-ui/**"
10-
- "apps/vscode-e2e/**"
11-
- "packages/core/**"
12-
- "package.json"
13-
- "pnpm-lock.yaml"
14-
- "turbo.json"
15-
- ".github/actions/setup-node-pnpm/**"
167
merge_group:
178
types: [checks_requested]
189

@@ -23,9 +14,36 @@ jobs:
2314
steps:
2415
- name: Checkout code
2516
uses: actions/checkout@v4
17+
18+
- name: Restore mocked E2E pass marker
19+
id: e2e-marker
20+
uses: actions/cache/restore@v4
21+
with:
22+
path: .cache/e2e-pass
23+
key: ${{ runner.os }}-mocked-e2e-${{ hashFiles('src/**', 'webview-ui/**', 'apps/vscode-e2e/**', 'packages/core/**', 'package.json', 'pnpm-lock.yaml', 'turbo.json', '.github/workflows/e2e.yml', '.github/actions/setup-node-pnpm/**') }}
24+
25+
- name: Use cached mocked E2E result
26+
if: github.event_name == 'pull_request' && steps.e2e-marker.outputs.cache-hit == 'true'
27+
run: echo "Skipping mocked E2E tests because this source hash already passed."
28+
2629
- name: Setup Node.js and pnpm
30+
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
2731
uses: ./.github/actions/setup-node-pnpm
2832
- name: Install xvfb
33+
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
2934
run: sudo apt-get install -y xvfb
3035
- name: Run mocked E2E tests
36+
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
3137
run: xvfb-run -a pnpm --filter @roo-code/vscode-e2e test:ci:mock
38+
39+
- name: Write mocked E2E pass marker
40+
if: steps.e2e-marker.outputs.cache-hit != 'true'
41+
run: mkdir -p .cache/e2e-pass && date -u > .cache/e2e-pass/passed
42+
43+
- name: Save mocked E2E pass marker
44+
if: steps.e2e-marker.outputs.cache-hit != 'true'
45+
continue-on-error: true
46+
uses: actions/cache/save@v4
47+
with:
48+
path: .cache/e2e-pass
49+
key: ${{ steps.e2e-marker.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)