chore: library migration + lint/format + CI playwright bootstrap #4
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| unit: | |
| name: Canvas unit tests (Node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ['20', '22'] | |
| defaults: | |
| run: | |
| working-directory: canvas | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'npm' | |
| cache-dependency-path: canvas/package-lock.json | |
| - run: npm ci | |
| - name: Install tools/ deps (canvas tests shell out to tools/*.cjs) | |
| working-directory: tools | |
| run: npm install | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('canvas/package-lock.json') }} | |
| - name: Install Playwright chromium (needed by render-engine tests) | |
| run: npx playwright install --with-deps chromium | |
| - run: npm test -- --run | |
| build: | |
| name: Canvas typecheck + build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: canvas | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: canvas/package-lock.json | |
| - run: npm ci | |
| - run: npm run build | |
| tools: | |
| name: CLI tools tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tools | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install tools deps | |
| run: npm install | |
| - run: npm test | |
| e2e: | |
| name: Playwright e2e | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: canvas | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: canvas/package-lock.json | |
| - run: npm ci | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('canvas/package-lock.json') }} | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| # webServer config in playwright.config.ts boots `npm run dev` and | |
| # waits for :5174 before running specs. | |
| run: npx playwright test --reporter=line |