Fix crypto tests on Node 18 (polyfill global Web Crypto in test env) #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| # These jobs never launch Electron — skip its ~100 MB binary download on install. | |
| env: | |
| ELECTRON_SKIP_BINARY_DOWNLOAD: '1' | |
| jobs: | |
| test: | |
| name: Test on Node ${{ matrix.node }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ['18', '20', '22'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm test | |
| typecheck: | |
| name: Type-check (JSDoc + checkJs) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type-check | |
| run: npm run typecheck | |
| e2e: | |
| name: End-to-end (Playwright) | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browser | |
| run: npm run e2e:install | |
| - name: Run E2E tests | |
| run: npm run e2e | |
| - name: Upload Playwright report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 | |
| build: | |
| name: Verify production build | |
| runs-on: ubuntu-latest | |
| needs: [test, typecheck] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Sanity-check dist/ | |
| run: | | |
| test -f dist/index.html || (echo "dist/index.html missing" && exit 1) | |
| test -d dist/assets || (echo "dist/assets missing" && exit 1) | |
| echo "dist size:" && du -sh dist |