-
Notifications
You must be signed in to change notification settings - Fork 30
45 lines (43 loc) · 1.48 KB
/
Copy pathe2-tests.yml
File metadata and controls
45 lines (43 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This to verify lib version bump doesn't break anything
name: E2E Tests
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**'
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "github-cd-bot@example.com"
- name: Install deps
run: npm i -g wait-for-localhost-cli && PUPPETEER_SKIP_DOWNLOAD=true npm i --legacy-peer-deps
- name: Run unit tests
run: npm test
- name: Build frontend
run: NODE_OPTIONS=--openssl-legacy-provider npm run build
- name: Start app and run tests
timeout-minutes: 10
run: |
node bin/codecept-ui.js -c node_modules/@codeceptjs/examples/codecept.conf.js &
BACKEND_PID=$!
echo "Backend PID: $BACKEND_PID"
timeout 90 bash -c 'until curl -sf http://localhost:3333 > /dev/null 2>&1; do echo "Waiting for backend..."; sleep 3; done' \
|| { echo "Backend failed to start within 90s"; kill $BACKEND_PID 2>/dev/null; exit 1; }
echo "Backend is up"
cd test/e2e
npm i
npx playwright install chromium
npx playwright install-deps chromium
npm run test
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}