Skip to content

Commit fd8383a

Browse files
alan-agius4mmalerba
authored andcommitted
ci: cache vscode binary in CI (angular#64219)
Caches the downloaded vscode binary in the CI workflows to speed up the e2e tests for the vscode extension. This avoids downloading vscode on every CI run. PR Close angular#64219
1 parent 8358c19 commit fd8383a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ jobs:
133133
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
134134
- name: Install node modules
135135
run: pnpm install --frozen-lockfile
136+
- name: Cache downloaded vscode binary
137+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
138+
with:
139+
path: '~/.cache/vscode-test'
140+
key: vscode-cache-${{ runner.os }}-${{ hashFiles('vscode-ng-language-service/integration/e2e/index.ts') }} # The version is specified in this file.
136141
- name: Run tests
137142
run: pnpm bazel test //vscode-ng-language-service/...
138143

.github/workflows/pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ jobs:
139139
uses: angular/dev-infra/github-actions/bazel/configure-remote@b7672ff60456719e6d9b0cc052abc73a7adc8df2
140140
- name: Install node modules
141141
run: pnpm install --frozen-lockfile
142+
- name: Cache downloaded vscode binary
143+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
144+
with:
145+
path: '~/.cache/vscode-test'
146+
key: vscode-cache-${{ runner.os }}-${{ hashFiles('vscode-ng-language-service/integration/e2e/index.ts') }} # The version is specified in this file.
142147
- name: Run tests
143148
run: pnpm bazel test //vscode-ng-language-service/...
144149

vscode-ng-language-service/integration/e2e/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {join} from 'node:path';
2-
import {tmpdir} from 'node:os';
2+
import {homedir, tmpdir} from 'node:os';
33
import {runTests} from '@vscode/test-electron';
44

55
import {PACKAGE_ROOT, PROJECT_PATH} from '../test_constants';
@@ -24,7 +24,7 @@ async function main() {
2424
extensionDevelopmentPath: EXT_DEVELOPMENT_PATH,
2525
extensionTestsPath: EXT_TESTS_PATH,
2626
// Avoid redownloading vscode if the test if flaky.
27-
cachePath: join(tmpdir(), 'vscode-cache'),
27+
cachePath: join(homedir(), '.cache/vscode-test'),
2828
launchArgs: [
2929
PROJECT_PATH,
3030
// This disables all extensions except the one being tested

0 commit comments

Comments
 (0)