Lay foundation for workspaces #66
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 Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| BACKEND_API_PADDLE_KEY: ${{ secrets.BACKEND_API_PADDLE_KEY }} | |
| BACKEND_API_PADDLE_URL: https://sandbox-api.paddle.com | |
| BACKEND_API_PADDLE_WEBHOOK_SECRET: ${{ secrets.BACKEND_API_PADDLE_WEBHOOK_SECRET }} | |
| VITE_PADDLE_CLIENT_TOKEN: ${{ secrets.VITE_PADDLE_CLIENT_TOKEN }} | |
| jobs: | |
| e2e-web: | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci -w e2e | |
| - name: Install Playwright Chromium | |
| run: npx playwright install --with-deps chromium | |
| # Backend-issued OAuth redirects (mock Discord login, mock Reddit authorize) | |
| # point the BROWSER at host.docker.internal so the same base URL also works | |
| # for containers reaching the host-side mock servers. Docker Desktop adds | |
| # that hostname to the host's hosts file, but Linux runners don't, so the | |
| # browser gets chrome-error://chromewebdata/ without this mapping. | |
| - name: Map host.docker.internal to localhost for the host-side browser | |
| run: echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts | |
| - name: Run E2E tests (web shard ${{ matrix.shard }}/4) | |
| working-directory: e2e | |
| run: bash e2e-mock.sh --project=e2e-web --shard=${{ matrix.shard }}/4 | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-web-report-shard-${{ matrix.shard }} | |
| path: | | |
| e2e/playwright-report/ | |
| e2e/test-results/ | |
| e2e/logs/ | |
| retention-days: 30 | |
| e2e-paddle: | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci -w e2e | |
| - name: Install Playwright Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: Install cloudflared | |
| run: | | |
| curl -fsSL -o cloudflared.deb https://github.com/cloudflare/cloudflared/releases/download/2026.5.1/cloudflared-linux-amd64.deb | |
| sudo dpkg -i cloudflared.deb | |
| # See the e2e-web job: lets the host-side browser follow OAuth redirects | |
| # that target host.docker.internal. | |
| - name: Map host.docker.internal to localhost for the host-side browser | |
| run: echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts | |
| - name: Run E2E tests (paddle) | |
| working-directory: e2e | |
| run: bash e2e-mock.sh --project=e2e-paddle | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-paddle-report | |
| path: | | |
| e2e/playwright-report/ | |
| e2e/test-results/ | |
| e2e/logs/ | |
| retention-days: 30 |