|
7 | 7 | build-test: |
8 | 8 | runs-on: ${{ matrix.os }} |
9 | 9 | strategy: |
| 10 | + fail-fast: false |
10 | 11 | matrix: |
11 | 12 | os: [ubuntu-24.04] |
12 | 13 | node: [22] |
13 | | - name: ${{ matrix.os }} and node ${{ matrix.node }} |
| 14 | + browser: [chromium, firefox] |
| 15 | + name: ${{ matrix.os }} / node ${{ matrix.node }} / ${{ matrix.browser }} |
14 | 16 | steps: |
15 | | - - uses: actions/checkout@v2 |
16 | | - - name: Setup node |
17 | | - uses: actions/setup-node@v1 |
| 17 | + - uses: actions/checkout@v6 |
| 18 | + - name: Setup project |
| 19 | + uses: ./.github/actions/setup-node-project |
18 | 20 | with: |
19 | | - node-version: ${{ matrix.node }} |
20 | | - - name: Install dependencies |
21 | | - run: | |
22 | | - npm ci |
23 | | - sudo apt-get install xvfb |
| 21 | + node-version: '${{ matrix.node }}' |
| 22 | + - name: Resolve Playwright version |
| 23 | + id: playwright |
| 24 | + run: echo "version=$(node -p "require('playwright/package.json').version")" >> "$GITHUB_OUTPUT" |
| 25 | + - name: Cache Playwright browsers |
| 26 | + id: playwright-cache |
| 27 | + uses: actions/cache@v5 |
| 28 | + with: |
| 29 | + path: ~/.cache/ms-playwright |
| 30 | + key: playwright-${{ matrix.os }}-${{ matrix.browser }}-${{ steps.playwright.outputs.version }} |
| 31 | + - name: Install Playwright browser |
| 32 | + if: steps.playwright-cache.outputs.cache-hit != 'true' |
| 33 | + run: npx playwright install ${{ matrix.browser }} |
| 34 | + - name: Install Playwright system deps |
| 35 | + run: sudo npx playwright install-deps ${{ matrix.browser }} |
24 | 36 | - name: Build |
25 | 37 | run: npm run build:release |
26 | 38 | - name: Archive build output |
27 | | - if: github.event_name != 'merge_group' |
28 | | - uses: actions/upload-artifact@v4 |
| 39 | + if: github.event_name != 'merge_group' && matrix.browser == 'chromium' |
| 40 | + uses: actions/upload-artifact@v7 |
29 | 41 | with: |
30 | | - name: build-results-${{ matrix.runs_on }}-node_${{ matrix.node }} |
| 42 | + name: build-results-${{ matrix.os }}-node_${{ matrix.node }} |
31 | 43 | path: dist |
32 | 44 | retention-days: 15 |
33 | 45 | - name: Validate generated typescript definitions |
34 | 46 | run: | |
35 | 47 | npx tsc -p tsconfig.esm-check.json |
36 | 48 | npx tsc -p tsconfig.umd-check.json |
37 | | - - name: Chrome and Firefox tests |
38 | | - run: xvfb-run --auto-servernum npm run test -- --browsers ChromeSwiftShader,Firefox |
| 49 | + - name: Smoke-test packed ESM tarball |
| 50 | + if: matrix.browser == 'chromium' |
| 51 | + run: | |
| 52 | + tarball=$(npm pack ./dist/esm --silent) |
| 53 | + mkdir -p /tmp/vtk-smoke |
| 54 | + cd /tmp/vtk-smoke |
| 55 | + npm init -y >/dev/null |
| 56 | + npm install --no-audit --no-fund "$GITHUB_WORKSPACE/$tarball" |
| 57 | + node -e "require('@kitware/vtk.js/Utilities/config/rules-vtk')" |
| 58 | + node -e "require('@kitware/vtk.js/Utilities/config/chainWebpack')" |
| 59 | + npx --no-install vtkDataConverter --help |
| 60 | + - name: Tests |
| 61 | + env: |
| 62 | + TEST_BROWSER: ${{ matrix.browser }} |
| 63 | + run: xvfb-run --auto-servernum npm test |
39 | 64 | - name: Archive test results |
40 | 65 | if: github.event_name != 'merge_group' && (success() || failure()) |
41 | | - uses: actions/upload-artifact@v4 |
| 66 | + uses: actions/upload-artifact@v7 |
42 | 67 | continue-on-error: true |
43 | 68 | with: |
44 | | - name: test-results-${{ matrix.runs_on }}-node_${{ matrix.node }} |
45 | | - path: Utilities/TestResults/Test-Report.html |
| 69 | + name: test-results-${{ matrix.os }}-node_${{ matrix.node }}-${{ matrix.browser }} |
| 70 | + path: Utilities/TestResults/ |
46 | 71 | retention-days: 15 |
0 commit comments