Skip to content

Commit 9e4ddcd

Browse files
committed
ci: deduplicate unit tests and add cross-platform matrix
Split CI into three jobs: - unit-test: runs on ubuntu, macOS, and Windows (matrix) - build: compiles and packages on self-hosted macOS - integration-test: extension + UI tests on self-hosted macOS Unit tests no longer run twice. The integration-test job only runs extension integration tests and UI tests, not unit tests. Closes #23 Closes #25 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 54ce7bd commit 9e4ddcd

1 file changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ concurrency:
1313
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1414

1515
jobs:
16+
unit-test:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v6
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version-file: .nvmrc
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run tests
37+
run: npm test
38+
1639
build:
1740
runs-on:
1841
- self-hosted
@@ -27,20 +50,20 @@ jobs:
2750
- name: Setup Node.js
2851
uses: actions/setup-node@v6
2952
with:
30-
node-version: 22
53+
node-version-file: .nvmrc
3154
cache: npm
3255

3356
- name: Install dependencies
3457
run: npm ci
3558

36-
- name: Run tests
37-
run: npm test
59+
- name: Compile
60+
run: npm run compile
3861

3962
- name: Package extension
4063
run: npm run package
4164

4265
integration-test:
43-
needs: build
66+
needs: [unit-test, build]
4467
runs-on:
4568
- self-hosted
4669
- macOS
@@ -54,14 +77,17 @@ jobs:
5477
- name: Setup Node.js
5578
uses: actions/setup-node@v6
5679
with:
57-
node-version: 22
80+
node-version-file: .nvmrc
5881
cache: npm
5982

6083
- name: Install dependencies
6184
run: npm ci
6285

63-
- name: Run VS Code extension tests
64-
run: npm run test:all
86+
- name: Compile extension and tests
87+
run: npm run compile && npm run compile-tests
88+
89+
- name: Run extension integration tests
90+
run: npm run test:extension
6591

6692
- name: Setup UI test VS Code
6793
run: npx extest setup-tests --code_version max --extensions_dir .vscode-test/extensions

0 commit comments

Comments
 (0)