Version Packages #786
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: E2E API Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'apps/backend/**' | |
| - 'packages/**' | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e-api: | |
| name: API E2E Tests (shard ${{ matrix.shard }}/${{ strategy.job-total }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # The e2e suite runs jest with maxWorkers:1 (parallel workers flake — they | |
| # share process state and overwrite the in-memory DB). To cut wall-clock | |
| # without reintroducing that flakiness, split the test files across separate | |
| # runner jobs with jest --shard: each shard stays single-worker and fully | |
| # isolated on its own runner. Bump the shard count if the suite grows. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| # No --ignore-scripts: native modules (better-sqlite3) and workspace | |
| # postinstall hooks must run for E2E tests to work. | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit --no-fund --loglevel error | |
| - name: Build all workspace packages | |
| run: npm run build --workspaces --if-present | |
| - name: Run API E2E tests | |
| run: npm run test:e2e -w @owox/backend -- --shard=${{ matrix.shard }}/${{ strategy.job-total }} | |
| env: | |
| NODE_ENV: test |