-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (82 loc) · 2.44 KB
/
e2e.yml
File metadata and controls
103 lines (82 loc) · 2.44 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: E2E (Drupal Demo)
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * 0"
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
DRUPAL_BASE_URL: http://127.0.0.1:8080
DRUPAL_ORIGIN_URL: http://127.0.0.1:8080
DRUPAL_PROXY_SECRET: test-secret
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json
- name: Install
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Start Drupal demo
run: |
docker compose -f demo/docker-compose.yml up -d --build
echo "Waiting for Drupal resolver…"
for i in $(seq 1 90); do
if curl -fsS "http://127.0.0.1:8080/jsonapi/resolve?path=/about-us&_format=json" | grep -q '"resolved":true'; then
exit 0
fi
sleep 2
done
docker compose -f demo/docker-compose.yml logs drupal
exit 1
- name: Run E2E (split_routing)
env:
DEPLOYMENT_MODE: split_routing
E2E_DEPLOYMENT_MODE: split_routing
EXPECT_LAYOUT: "1"
run: |
set -euo pipefail
npm run build
npm run start -- -p 3000 &
server_pid=$!
for i in $(seq 1 60); do
if curl -fsS "http://127.0.0.1:3000/about-us" >/dev/null; then
break
fi
sleep 1
done
npm run test:e2e
kill "$server_pid"
- name: Run E2E (nextjs_first)
env:
DEPLOYMENT_MODE: nextjs_first
E2E_DEPLOYMENT_MODE: nextjs_first
EXPECT_LAYOUT: "1"
run: |
set -euo pipefail
npm run build
npm run start -- -p 3000 &
server_pid=$!
for i in $(seq 1 60); do
if curl -fsS "http://127.0.0.1:3000/about-us" >/dev/null; then
break
fi
sleep 1
done
npm run test:e2e
kill "$server_pid"
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report
if-no-files-found: ignore
- name: Shutdown demo
if: always()
run: docker compose -f demo/docker-compose.yml down -v