Skip to content

Commit f45bd37

Browse files
authored
fix: run tests in ci (#10)
* fix: run tests in ci * fix: ci xvfb-run * refactor: break things apart more
1 parent 401a1a2 commit f45bd37

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed
Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Please
1+
name: CI
22

33
on:
44
pull_request:
@@ -11,7 +11,7 @@ permissions:
1111
pull-requests: write
1212

1313
jobs:
14-
build:
14+
test:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -20,15 +20,12 @@ jobs:
2020
cache: "yarn"
2121
- name: Install dependencies
2222
run: yarn install --frozen-lockfile
23-
- name: Compile and package extension
23+
- name: Setup Xvfb
2424
run: |
25-
yarn global add @vscode/vsce
26-
vsce package --yarn
27-
- name: Upload artifact
28-
uses: actions/upload-artifact@v4
29-
with:
30-
name: vsix-package
31-
path: "*.vsix"
25+
sudo apt-get update
26+
sudo apt-get install -y xvfb
27+
- name: Test
28+
run: xvfb-run -a yarn test
3229
release-please:
3330
runs-on: ubuntu-latest
3431
outputs:
@@ -44,6 +41,26 @@ jobs:
4441
id: release
4542
with:
4643
token: ${{ steps.app-token.outputs.token }}
44+
build:
45+
runs-on: ubuntu-latest
46+
needs: [release-please, test]
47+
if: ${{ needs.release-please.outputs.release_created }}
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-node@v4
51+
with:
52+
cache: "yarn"
53+
- name: Install dependencies
54+
run: yarn install --frozen-lockfile
55+
- name: Compile and package extension
56+
run: |
57+
yarn global add @vscode/vsce
58+
vsce package --yarn
59+
- name: Upload artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: vsix-package
63+
path: "*.vsix"
4764
upload-release:
4865
runs-on: ubuntu-latest
4966
needs: [release-please, build]

.vscode-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ module.exports = defineConfig({
77
ui: "tdd",
88
timeout: 20000,
99
},
10-
useInstallation: {
11-
fromPath: process.env.VSCODE_TEST_VERSION || "stable",
12-
},
10+
version: process.env.VSCODE_TEST_VERSION || "stable",
1311
launchArgs: ["--disable-extensions", "--disable-gpu"],
1412
env: {
1513
DISPLAY: ":99.0",

0 commit comments

Comments
 (0)