Skip to content

Commit cf02ccf

Browse files
committed
Update with speed section with GH actions guide
1 parent ec6903f commit cf02ccf

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

tutorial/stage-3-endform-integration/speeding-up-with-endform.mdx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 4
66
---
77

8-
import { Aside } from '@astrojs/starlight/components';
8+
import { Aside, Tabs, TabItem } from '@astrojs/starlight/components';
99
import { Image } from "astro:assets";
1010
import TestTimeChart from "../../../assets/test-time-chart.png";
1111

@@ -80,4 +80,54 @@ Like:
8080
- How slow the slowest test is
8181
- How performant the app the tests are run against is
8282

83-
We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like.
83+
We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like.
84+
85+
## Running in CI
86+
87+
Let's make a CI workflow that runs the tests with Endform.
88+
89+
<Tabs>
90+
<TabItem label=".github/workflows/e2e-tests.yml">
91+
```yaml
92+
name: Endform tests on main
93+
94+
on:
95+
repository_dispatch:
96+
types:
97+
- 'vercel.deployment.success'
98+
99+
jobs:
100+
e2e-tests:
101+
timeout-minutes: 5
102+
runs-on: ubuntu-latest
103+
steps:
104+
- name: Checkout code
105+
uses: actions/checkout@v4
106+
107+
- name: Set up pnpm
108+
uses: pnpm/action-setup@v4
109+
110+
- name: Setup Node.js
111+
uses: actions/setup-node@v4
112+
with:
113+
node-version: lts/*
114+
cache: 'pnpm'
115+
116+
- name: Install dependencies
117+
run: pnpm install
118+
119+
- name: Run Playwright tests with Endform
120+
run: npx endform@latest test
121+
env:
122+
ENDFORM_API_KEY: ${{ secrets.ENDFORM_API_KEY }}
123+
```
124+
</TabItem>
125+
</Tabs>
126+
127+
Here we used the [`repository_dispatch` event](https://vercel.com/docs/git/vercel-for-github#repository-dispatch-events) to trigger the workflow when the Vercel deployment is successful.
128+
129+
Some other thigns you could try are:
130+
131+
- Just trigger on commits to the main branch
132+
- Triggering on pull requests
133+
- Sending a message to a Slack channel when the tests are successful or fail

0 commit comments

Comments
 (0)