Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

e2e.yml

97 lines3.0 KB

1name: E2E Tests
2​
3on:
4 pull_request:
5 push:
6 branches: [main, alpha, beta, rc]
7​
8concurrency:
9 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
10 cancel-in-progress: true
11​
12env:
13 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
14​
15permissions:
16 contents: read
17​
18jobs:
19 e2e:
20 name: E2E Shard ${{ matrix.shard }}/4
21 runs-on: ubuntu-latest
22 timeout-minutes: 30
23 strategy:
24 # Let every shard finish, so one run shows all failing tests.
25 fail-fast: false
26 matrix:
27 shard: [1, 2, 3, 4]
28 steps:
29 - name: Checkout
30 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31 with:
32 fetch-depth: 0
33 persist-credentials: false
34​
35 - name: Setup Tools
36 uses: TanStack/config/.github/setup@190f659075ff0845850e330883eb26d7ffd0671f # main
37​
38 - name: Cache Playwright Browsers
39 id: playwright-cache
40 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
41 with:
42 path: ~/.cache/ms-playwright
43 key: playwright-${{ hashFiles('testing/e2e/package.json') }}
44 restore-keys: |
45 playwright-
46​
47 - name: Build Packages
48 run: pnpm run build:all
49​
50 # GitHub-hosted ubuntu-24.04 already has Chromium system libs.
51 # install-deps / --with-deps run apt-get against azure.archive.ubuntu.com
52 # and that mirror hangs, which kills this job.
53 - name: Install Playwright Chromium
54 if: steps.playwright-cache.outputs.cache-hit != 'true'
55 run: pnpm --filter @tanstack/ai-e2e exec playwright install chromium
56​
57 - name: Run E2E Tests
58 env:
59 SHARD: ${{ matrix.shard }}
60 run: pnpm --filter @tanstack/ai-e2e test:e2e --shard="$SHARD/4"
61​
62 - name: Upload Video Recordings
63 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
64 if: always()
65 with:
66 name: e2e-videos-${{ matrix.shard }}
67 path: testing/e2e/test-results/**/*.webm
68 retention-days: 14
69​
70 - name: Upload Playwright Report
71 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
72 if: always()
73 with:
74 name: e2e-report-${{ matrix.shard }}
75 path: testing/e2e/playwright-report/
76 retention-days: 14
77​
78 - name: Upload Traces (on failure)
79 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
80 if: failure()
81 with:
82 name: e2e-traces-${{ matrix.shard }}
83 path: testing/e2e/test-results/**/*.zip
84 retention-days: 14
85​
86 # Branch rules require a check named "E2E Tests". The shards above have
87 # other names, so this job reports their combined result under that name.
88 e2e-result:
89 name: E2E Tests
90 needs: e2e
91 if: ${{ !cancelled() }}
92 runs-on: ubuntu-latest
93 steps:
94 - name: Check shard results
95 env:
96 RESULT: ${{ needs.e2e.result }}
97 run: test "$RESULT" = success