| 1 | name: End-to-end |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | |
| 8 | permissions: |
| 9 | contents: read |
| 10 | |
| 11 | concurrency: |
| 12 | group: e2e-${{ github.ref }} |
| 13 | cancel-in-progress: true |
| 14 | |
| 15 | jobs: |
| 16 | # The suite in two parallel shards of about the same length: the git, pull request |
| 17 | # and Actions file on its own, and every other test/e2e/*.test.mjs file (so a new |
| 18 | # file runs without editing this). Only the second shard needs a browser (passkeys). |
| 19 | e2e: |
| 20 | name: End-to-end (${{ matrix.name }}) |
| 21 | runs-on: ubuntu-latest |
| 22 | timeout-minutes: 20 |
| 23 | strategy: |
| 24 | fail-fast: false |
| 25 | matrix: |
| 26 | include: |
| 27 | - name: git, PRs, Actions |
| 28 | shard: core |
| 29 | - name: passkeys, registry, email, security |
| 30 | shard: rest |
| 31 | steps: |
| 32 | - uses: actions/checkout@v4 |
| 33 | - uses: pnpm/action-setup@v4 |
| 34 | - uses: actions/setup-node@v4 |
| 35 | with: |
| 36 | node-version: 22 |
| 37 | cache: pnpm |
| 38 | - run: pnpm install --frozen-lockfile |
| 39 | - run: pnpm -r --if-present build |
| 40 | - if: matrix.shard == 'rest' |
| 41 | run: pnpm --filter @diffinery/app exec playwright install --with-deps chromium |
| 42 | - name: Run the shard's tests |
| 43 | working-directory: apps/diffinery |
| 44 | run: | |
| 45 | if [ "${{ matrix.shard }}" = core ]; then files=test/e2e/e2e.test.mjs; else files=$(ls test/e2e/*.test.mjs | grep -v '/e2e\.test\.mjs$'); fi |
| 46 | echo "$files" |
| 47 | node --test --test-concurrency=1 --test-timeout=600000 $files |