-
Notifications
You must be signed in to change notification settings - Fork 127
62 lines (52 loc) · 1.54 KB
/
e2e-tests.yml
File metadata and controls
62 lines (52 loc) · 1.54 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: E2E Tests
on:
pull_request:
push:
branches: [trunk]
jobs:
e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: pnpm
cache-dependency-path: tests/e2e/pnpm-lock.yaml
- name: Install dependencies
working-directory: tests/e2e
run: pnpm install --frozen-lockfile
- name: Start Docker environment
working-directory: tests/e2e
run: docker compose up -d --build --wait
- name: Wait for WordPress
run: |
echo "Waiting for WordPress to be ready..."
for i in $(seq 1 30); do
if curl -sf http://localhost:2022/ > /dev/null 2>&1; then
echo "WordPress is ready."
exit 0
fi
echo "Attempt $i/30 - waiting 5s..."
sleep 5
done
echo "WordPress did not become ready in time."
docker compose -f tests/e2e/docker-compose.yml --project-directory tests/e2e logs
exit 1
- name: Run e2e tests
working-directory: tests/e2e
run: pnpm test:run
- name: Docker logs
if: failure()
working-directory: tests/e2e
run: docker compose logs
- name: Tear down Docker environment
if: always()
working-directory: tests/e2e
run: docker compose down -v