Skip to content

Commit f233584

Browse files
committed
ci: add pull request extension checks
1 parent 2cb6a5e commit f233584

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
unit-and-package:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
cache: npm
25+
- run: npm ci
26+
- run: npm test
27+
- run: npm run package
28+
- name: Verify VSIX archive
29+
run: unzip -t mcpp-vscode-*.vsix
30+
31+
extension-host-e2e:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version: 22
38+
cache: npm
39+
- run: npm ci
40+
- name: Run Extension Host smoke tests
41+
run: xvfb-run -a npm run test:e2e

test/artifacts.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,19 @@ test("tag release 工作流校验版本并发布 VSIX", () => {
334334
assert.match(workflow, /gh release create/);
335335
assert.match(workflow, /gh release upload.*--clobber/s);
336336
});
337+
338+
test("PR CI 分离单元打包和 Extension Host E2E", () => {
339+
const workflow = readFileSync(path.join(root, ".github/workflows/ci.yml"), "utf8");
340+
assert.match(workflow, /pull_request:/);
341+
assert.match(workflow, /push:\s*\n\s+branches:\s*\n\s+- main/);
342+
assert.match(workflow, /permissions:\s*\n\s+contents: read/);
343+
assert.match(workflow, /concurrency:[\s\S]*cancel-in-progress: true/);
344+
assert.match(workflow, /node-version: 22/);
345+
assert.match(workflow, /unit-and-package:/);
346+
assert.match(workflow, /extension-host-e2e:/);
347+
assert.match(workflow, /npm ci/);
348+
assert.match(workflow, /npm test/);
349+
assert.match(workflow, /npm run package/);
350+
assert.match(workflow, /unzip -t/);
351+
assert.match(workflow, /xvfb-run -a npm run test:e2e/);
352+
});

0 commit comments

Comments
 (0)