Skip to content

Commit d6bf548

Browse files
ci: upload concise Windows failure context
1 parent 190488a commit d6bf548

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,23 @@ jobs:
1717
- name: Syntax check
1818
working-directory: global-template/docgen
1919
run: npm run check
20-
- name: Unit and integration tests with concise failure output
20+
- name: Unit and integration tests with concise failure artifact
2121
working-directory: global-template/docgen
2222
shell: pwsh
2323
run: |
2424
npm test *> test-output.log
2525
$exitCode = $LASTEXITCODE
2626
if ($exitCode -ne 0) {
27-
Write-Host '=== FAILURE CONTEXT ==='
28-
Select-String -Path test-output.log -Pattern 'not ok|AssertionError|ERR_ASSERTION|error:|failureType|expected:|actual:' -Context 4,12
27+
Select-String -Path test-output.log -Pattern 'not ok|AssertionError|ERR_ASSERTION|error:|failureType|expected:|actual:|operator:|stack:' -Context 6,20 | Out-String -Width 500 | Set-Content failure-context.txt
28+
Get-Content failure-context.txt
2929
exit $exitCode
3030
}
3131
Get-Content test-output.log -Tail 30
32+
- name: Upload Windows failure context
33+
if: always()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: windows-failure-context
37+
if-no-files-found: error
38+
retention-days: 3
39+
path: global-template/docgen/failure-context.txt

0 commit comments

Comments
 (0)