Skip to content

Commit f316fa7

Browse files
committed
Update workflows
1 parent ea90b78 commit f316fa7

6 files changed

Lines changed: 117 additions & 35 deletions

File tree

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
1-
name: Endform tests on main
1+
name: Run end to end tests with endform on main 2
22

33
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
711

812
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:
1214
runs-on: ubuntu-latest
13-
permissions:
14-
actions: read
15-
statuses: write
16-
contents: read
1715
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-
2616
- name: Checkout code
2717
uses: actions/checkout@v4
2818
with:
2919
fetch-depth: 0
3020

31-
- name: Set up pnpm
32-
uses: pnpm/action-setup@v4
33-
3421
- name: Setup Node.js
3522
uses: actions/setup-node@v4
3623
with:
3724
node-version: lts/*
3825
cache: 'pnpm'
26+
27+
- name: Set up pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
run_install: true
3931

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
4238

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

‎.github/workflows/endform-tests-on-prs.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
with:
3636
project-name: endform-playwright-tutorial
3737
set-url-env-var: BASE_URL # Sets the Vercel preview URL as the BASE_URL environment variable
38+
set-vercel-bypass-env-var: VERCEL_BYPASS_TOKEN # Exports a deployment protection bypass token as this env var
3839

3940
- name: Run end to end tests with endform
4041
run: |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
These files need to be copied to .github/workflows to take effect
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Endform tests on main
2+
3+
on:
4+
repository_dispatch:
5+
types:
6+
- 'vercel.deployment.success'
7+
8+
jobs:
9+
e2e-tests:
10+
if: github.event.client_payload.git.ref == 'main' && github.event.client_payload.environment == 'production'
11+
timeout-minutes: 5
12+
runs-on: ubuntu-latest
13+
permissions:
14+
actions: read
15+
statuses: write
16+
contents: read
17+
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+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: lts/*
35+
cache: 'pnpm'
36+
37+
- name: Set up pnpm
38+
uses: pnpm/action-setup@v4
39+
with:
40+
run_install: true
41+
42+
- name: Run Playwright tests with Endform
43+
run: npx endform@latest test
44+
env:
45+
ENDFORM_API_KEY: ${{ secrets.ENDFORM_API_KEY }}

.github/workflows/endform-tests-on-main2.yml renamed to copy-me-githhub-workflows/workflows/endform-tests-on-main.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,23 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Set up pnpm
22-
uses: pnpm/action-setup@v4
23-
2421
- name: Setup Node.js
2522
uses: actions/setup-node@v4
2623
with:
2724
node-version: lts/*
2825
cache: 'pnpm'
29-
30-
- name: Install dependencies
31-
run: pnpm install
26+
27+
- name: Set up pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
run_install: true
3231

3332
- name: Wait for Vercel deployment
3433
uses: endformdev/actions/run-with-vercel-deployment@main
3534
with:
3635
project-name: endform-playwright-tutorial
3736
set-url-env-var: BASE_URL # Sets the Vercel preview URL as the BASE_URL environment variable
38-
set-vercel-bypass-env-var: VERCEL_BYPASS_TOKEN
37+
set-vercel-bypass-env-var: VERCEL_BYPASS_TOKEN # Exports a deployment protection bypass token as this env var
3938

4039
- name: Run end to end tests with endform
4140
run: |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run end to end tests with endform
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
id-token: write # required for authentication with Endform
11+
12+
jobs:
13+
e2e:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: lts/*
25+
cache: 'pnpm'
26+
27+
- name: Set up pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
run_install: true
31+
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
38+
39+
- name: Run end to end tests with endform
40+
run: |
41+
npx endform@latest test

0 commit comments

Comments
 (0)