|
1 | | -name: Windows diagnostic |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: ['main', 'agent/**'] |
4 | 6 | pull_request: |
5 | 7 |
|
6 | 8 | permissions: |
7 | 9 | contents: read |
8 | 10 |
|
9 | 11 | jobs: |
10 | | - windows-test: |
11 | | - runs-on: windows-latest |
| 12 | + test: |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - os: ubuntu-latest |
| 18 | + node-version: 22 |
| 19 | + upload-source: false |
| 20 | + - os: ubuntu-latest |
| 21 | + node-version: 24 |
| 22 | + upload-source: true |
| 23 | + - os: windows-latest |
| 24 | + node-version: 24 |
| 25 | + upload-source: false |
| 26 | + runs-on: ${{ matrix.os }} |
12 | 27 | steps: |
13 | 28 | - uses: actions/checkout@v4 |
14 | 29 | - uses: actions/setup-node@v4 |
15 | 30 | with: |
16 | | - node-version: 24 |
| 31 | + node-version: ${{ matrix.node-version }} |
| 32 | + cache: npm |
| 33 | + cache-dependency-path: global-template/docgen/package.json |
17 | 34 | - name: Syntax check |
18 | 35 | working-directory: global-template/docgen |
19 | 36 | run: npm run check |
20 | | - - name: Unit and integration tests with concise failure artifact |
| 37 | + - name: Unit and integration tests |
21 | 38 | working-directory: global-template/docgen |
22 | | - shell: pwsh |
23 | | - run: | |
24 | | - npm test *> test-output.log |
25 | | - $exitCode = $LASTEXITCODE |
26 | | - if ($exitCode -ne 0) { |
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 |
29 | | - exit $exitCode |
30 | | - } |
31 | | - Get-Content test-output.log -Tail 30 |
32 | | - - name: Upload Windows failure context |
33 | | - if: always() |
| 39 | + run: npm test |
| 40 | + - name: Installer dry run |
| 41 | + run: node install.mjs --dry-run --no-link-cli |
| 42 | + - name: Upload exact CI source |
| 43 | + if: always() && matrix.upload-source |
34 | 44 | uses: actions/upload-artifact@v4 |
35 | 45 | with: |
36 | | - name: windows-failure-context |
| 46 | + name: docgen-ci-source |
37 | 47 | if-no-files-found: error |
38 | 48 | retention-days: 3 |
39 | | - path: global-template/docgen/failure-context.txt |
| 49 | + path: | |
| 50 | + global-template/docgen |
| 51 | + global-template/docgen/project-template |
| 52 | + install.mjs |
| 53 | + VERSION |
0 commit comments