-
-
Notifications
You must be signed in to change notification settings - Fork 393
79 lines (66 loc) · 2.26 KB
/
e2e-modern-ssr.yml
File metadata and controls
79 lines (66 loc) · 2.26 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
name: E2E Test for ModernJS SSR
on:
workflow_call:
jobs:
e2e-modern:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Cache Tool Downloads
uses: actions/cache@v5
with:
path: ~/.cache
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-toolcache-
- name: Set Playwright cache status
run: |
if [ -d "$HOME/.cache/ms-playwright" ] || [ -d "$HOME/.cache/Cypress" ]; then
echo "PLAYWRIGHT_CACHE_HIT=true" >> "$GITHUB_ENV"
else
echo "PLAYWRIGHT_CACHE_HIT=false" >> "$GITHUB_ENV"
fi
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Set Nx SHA
uses: nrwl/nx-set-shas@v4
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> "$GITHUB_ENV"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Cypress
run: npx cypress install
- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg
- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=modernjs
- name: E2E Test for Modern.js SSR
if: steps.check-ci.outcome == 'success'
uses: nick-fields/retry@v3
with:
max_attempts: 2
timeout_minutes: 10
command: |
lsof -ti tcp:3050,3051,3052,3053,3054,3055,3056 | xargs -r kill &&
pnpm run app:modern:dev &
sleep 30 &&
for port in 3050 3051 3052 3053 3054 3055 3056; do
while true; do
response=$(curl -s http://127.0.0.1:$port/mf-manifest.json)
if echo "$response" | jq empty >/dev/null 2>&1; then
break
fi
sleep 1
done
done