|
1 | | -name: Endform tests on main |
| 1 | +name: Run end to end tests with endform on main 2 |
2 | 2 |
|
3 | 3 | on: |
4 | | - repository_dispatch: |
5 | | - types: |
6 | | - - 'vercel.deployment.success' |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + id-token: write # required for authentication with Endform |
7 | 11 |
|
8 | 12 | jobs: |
9 | | - e2e-tests: |
10 | | - if: github.event.client_payload.git.ref == 'main' && github.event.client_payload.environment == 'production' |
11 | | - timeout-minutes: 5 |
| 13 | + e2e: |
12 | 14 | runs-on: ubuntu-latest |
13 | | - permissions: |
14 | | - actions: read |
15 | | - statuses: write |
16 | | - contents: read |
17 | 15 | steps: |
18 | | - - name: Vercel Repository Dispatch Debug |
19 | | - uses: vercel/repository-dispatch/actions/debug@v1 |
20 | | - |
21 | | - - name: With Commit Status |
22 | | - uses: vercel/repository-dispatch/actions/status@v1 |
23 | | - with: |
24 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
25 | | - |
26 | 16 | - name: Checkout code |
27 | 17 | uses: actions/checkout@v4 |
28 | 18 | with: |
29 | 19 | fetch-depth: 0 |
30 | 20 |
|
31 | | - - name: Set up pnpm |
32 | | - uses: pnpm/action-setup@v4 |
33 | | - |
34 | 21 | - name: Setup Node.js |
35 | 22 | uses: actions/setup-node@v4 |
36 | 23 | with: |
37 | 24 | node-version: lts/* |
38 | 25 | cache: 'pnpm' |
| 26 | + |
| 27 | + - name: Set up pnpm |
| 28 | + uses: pnpm/action-setup@v4 |
| 29 | + with: |
| 30 | + run_install: true |
39 | 31 |
|
40 | | - - name: Install dependencies |
41 | | - run: pnpm install |
| 32 | + - name: Wait for Vercel deployment |
| 33 | + uses: endformdev/actions/run-with-vercel-deployment@main |
| 34 | + with: |
| 35 | + project-name: endform-playwright-tutorial |
| 36 | + set-url-env-var: BASE_URL # Sets the Vercel preview URL as the BASE_URL environment variable |
| 37 | + set-vercel-bypass-env-var: VERCEL_BYPASS_TOKEN # Exports a deployment protection bypass token as this env var |
42 | 38 |
|
43 | | - - name: Run Playwright tests with Endform |
44 | | - run: npx endform@latest test |
45 | | - env: |
46 | | - ENDFORM_API_KEY: ${{ secrets.ENDFORM_API_KEY }} |
| 39 | + - name: Run end to end tests with endform |
| 40 | + run: | |
| 41 | + npx endform@latest test |
0 commit comments