chore: add typescript checks to the ci #72
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| setup: | |
| name: 'setup' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| integration-matrix: ${{ steps.discover.outputs.integration }} | |
| e2e-matrix: ${{ steps.discover.outputs.e2e }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Discover test packages | |
| id: discover | |
| run: node --experimental-strip-types .github/scripts/discover-test-packages.ts | |
| lint: | |
| needs: [setup] | |
| name: 'lint' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Run linting | |
| run: pnpm run lint | |
| typescript: | |
| needs: [setup] | |
| name: 'typescript' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Run TypeScript checks | |
| run: pnpm run check-types | |
| test-integration: | |
| needs: [setup, lint, typescript] | |
| name: 'test:integration (${{ matrix.name }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.setup.outputs.integration-matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Run build | |
| run: pnpm run build | |
| - name: Run integration tests | |
| run: pnpm --filter='${{ matrix.package }}' run test:integration | |
| test-e2e: | |
| needs: [setup, lint, typescript] | |
| name: 'test:e2e (${{ matrix.name }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.setup.outputs.e2e-matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Run build | |
| run: pnpm run build | |
| - name: Run e2e tests | |
| run: pnpm --filter='${{ matrix.package }}' run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-${{ matrix.name }} | |
| path: '**/playwright-report/' | |
| retention-days: 30 |