-
-
Notifications
You must be signed in to change notification settings - Fork 15
108 lines (90 loc) · 3.15 KB
/
build.yml
File metadata and controls
108 lines (90 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [22.x, 24.x]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: vscode-extension/package-lock.json
- name: Install dependencies
working-directory: vscode-extension
run: npm ci
- name: Validate JSON files
working-directory: vscode-extension
run: npm run lint:json
- name: Run linting
working-directory: vscode-extension
run: npm run lint
- name: Run type checking
working-directory: vscode-extension
run: npm run check-types
- name: Compile extension
working-directory: vscode-extension
run: npm run compile
- name: Build production package
working-directory: vscode-extension
run: npm run package
- name: Compile tests
working-directory: vscode-extension
run: npm run compile-tests
- name: Run Node.js unit tests
working-directory: vscode-extension
shell: bash
run: |
set +e
node --require ./out/test/unit/vscode-shim-register.js \
--experimental-test-coverage \
--test \
--test-force-exit \
--test-coverage-include=out/src/backend/**/*.js \
--test-coverage-include=out/src/utils/**/*.js \
out/test/unit/*.test.js 2>&1 | tee "$RUNNER_TEMP/test-output.txt"
status=${PIPESTATUS[0]}
set -e
exit "$status"
- name: Publish test results to step summary
if: always()
shell: bash
run: node scripts/parse-test-output.js "$RUNNER_TEMP/test-output.txt" >> "$GITHUB_STEP_SUMMARY"
- name: Verify build outputs exist
shell: bash
run: |
if [ ! -f "vscode-extension/dist/extension.js" ]; then
echo "❌ vscode-extension/dist/extension.js not found"
exit 1
fi
if [ ! -d "vscode-extension/out" ]; then
echo "❌ vscode-extension/out directory not found"
exit 1
fi
echo "✅ Build outputs verified"
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '24.x'
with:
name: build-artifacts
path: |
vscode-extension/dist/extension.js
vscode-extension/dist/extension.js.map
vscode-extension/out/
retention-days: 7