@@ -106,122 +106,6 @@ jobs:
106106 vscode-extension/out/
107107 retention-days : 7
108108
109- check-code-changes :
110- runs-on : ubuntu-latest
111- if : github.event_name == 'pull_request'
112- outputs :
113- vscode_src_changed : ${{ steps.detect.outputs.changed }}
114- steps :
115- - name : Harden the runner (Audit all outbound calls)
116- uses : step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
117- with :
118- egress-policy : audit
119-
120- - name : Checkout code
121- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
122- with :
123- fetch-depth : 0
124-
125- - name : Detect vscode-extension source changes
126- id : detect
127- run : |
128- changed=$(git diff --name-only origin/${{ github.base_ref }}...HEAD \
129- | grep -cE '^vscode-extension/src/.*\.ts$|^vscode-extension/test/.*\.ts$|^vscode-extension/stryker\.config\.mjs$' || true)
130- if [ "$changed" -gt 0 ]; then
131- echo "changed=true" >> "$GITHUB_OUTPUT"
132- else
133- echo "changed=false" >> "$GITHUB_OUTPUT"
134- fi
135-
136- mutation-testing :
137- runs-on : ubuntu-latest
138- needs : [build, check-code-changes]
139- if : github.event_name == 'pull_request' && needs.check-code-changes.outputs.vscode_src_changed == 'true'
140- # Informational — does not block the PR. A failing mutation score
141- # is visible in the artifact but does not block merging during rollout.
142- continue-on-error : true
143-
144- steps :
145- - name : Harden the runner (Audit all outbound calls)
146- uses : step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
147- with :
148- egress-policy : audit
149-
150- - name : Checkout code
151- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
152-
153- - name : Setup Node.js
154- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
155- with :
156- node-version : ' 24.x'
157- cache : ' npm'
158- cache-dependency-path : vscode-extension/package-lock.json
159-
160- - name : Install dependencies
161- working-directory : vscode-extension
162- run : npm ci
163-
164- - name : Compile tests
165- working-directory : vscode-extension
166- run : npm run compile-tests
167-
168- - name : Run mutation tests
169- working-directory : vscode-extension
170- run : npx stryker run
171- timeout-minutes : 60
172- # Step-level continue-on-error keeps the job green even on timeout/failure.
173- # Job-level continue-on-error alone only keeps the workflow green but still
174- # marks the job check as FAILURE, which blocks merge via rulesets.
175- continue-on-error : true
176-
177- - name : Publish mutation summary
178- if : always()
179- working-directory : vscode-extension
180- shell : bash
181- run : |
182- if [ -f "reports/mutation/mutation.json" ]; then
183- node -e "
184- const fs = require('fs');
185- const r = JSON.parse(fs.readFileSync('reports/mutation/mutation.json', 'utf8'));
186- let killed=0, survived=0, timedOut=0, noCoverage=0, total=0;
187- for (const f of Object.values(r.files || {})) {
188- for (const m of (f.mutants || [])) {
189- total++;
190- if (m.status === 'Killed') killed++;
191- else if (m.status === 'Survived') survived++;
192- else if (m.status === 'Timeout') timedOut++;
193- else if (m.status === 'NoCoverage') noCoverage++;
194- }
195- }
196- const denominator = killed + survived + timedOut;
197- const score = denominator > 0 ? ((killed / denominator) * 100).toFixed(1) : '0.0';
198- const lines = [
199- '## 🧬 Mutation Testing Results',
200- '',
201- '| Metric | Value |',
202- '|--------|-------|',
203- \`| 📊 Score | \${score}% |\`,
204- \`| ✅ Killed | \${killed} |\`,
205- \`| ⚠️ Survived | \${survived} |\`,
206- \`| ⏱️ Timeout | \${timedOut} |\`,
207- \`| 🚫 No coverage | \${noCoverage} |\`,
208- \`| Total | \${total} |\`,
209- ].join('\n');
210- fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, lines + '\n');
211- "
212- else
213- printf '## 🧬 Mutation Testing\n\n⚠️ Report not generated (Stryker timed out or errored).\n' >> "$GITHUB_STEP_SUMMARY"
214- fi
215-
216- - name : Upload mutation report
217- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
218- if : always()
219- with :
220- name : mutation-report
221- path : vscode-extension/reports/mutation/
222- if-no-files-found : ignore
223- retention-days : 14
224-
225109 package :
226110 runs-on : ubuntu-latest
227111 needs : build
0 commit comments