ci: deploy the Paper site from main #18
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] | |
| # Least privilege: CI only needs to read the repo. | |
| permissions: | |
| contents: read | |
| # Cancel superseded runs on the same ref to save minutes. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: test (${{ matrix.os }} · node ${{ matrix.node }}) | |
| runs-on: ${{ matrix.os }} | |
| # Windows support is not yet verified (raw-mode TTY / ANSI paths are | |
| # Unix-oriented). Run it so we see reality, but don't block merges on it. | |
| continue-on-error: ${{ matrix.experimental || false }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| node: ['18', '20', '22'] | |
| include: | |
| - os: macos-latest | |
| node: '20' | |
| - os: windows-latest | |
| node: '20' | |
| experimental: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| demos: | |
| name: demos (ubuntu · node 20) | |
| runs-on: ubuntu-latest | |
| # PTY-driven demo/emulator E2E suites. Blocking: the full demo suite | |
| # (`npx tsx test/run-all.ts --demos`) is green, and QA suites now promote | |
| # detected layout bugs to real failures. | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Demo emulator tests | |
| run: npx tsx test/run-all.ts --demos | |
| audit: | |
| name: audit (production deps) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| # Audit what users install by default (runtime deps), not dev tooling. | |
| - name: Audit production dependencies | |
| run: npm audit --omit=dev --audit-level=high | |
| # ssh2 is an optional peer dep that `serve` users are told to install, | |
| # but it lives in devDependencies here, so --omit=dev skips it. Audit | |
| # the full tree too so advisories against ssh2 (and its subtree) still | |
| # fail CI. | |
| - name: Audit full tree (covers ssh2 serve dependency) | |
| run: npm audit --audit-level=high |