forked from GaijinEntertainment/daScript
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 3.24 KB
/
playground-e2e.yml
File metadata and controls
100 lines (86 loc) · 3.24 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
name: Playground e2e (no WASM)
# Fast PR gate: builds the site without WASM (skips the 5-10 min Emscripten
# step) and runs the Playwright suite minus any specs tagged `@wasm`. The full
# WASM suite is reserved for the master-only workflow (forthcoming).
on:
pull_request:
paths:
- 'site/**'
- 'web/examples/ui/**'
- '.github/workflows/playground-e2e.yml'
push:
branches-ignore: [master]
paths:
- 'site/**'
- 'web/examples/ui/**'
- '.github/workflows/playground-e2e.yml'
workflow_dispatch:
jobs:
playwright:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: site/tests/playground/package-lock.json
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Install Python build deps"
run: pip install markdown
- name: "Stage _site (no WASM)"
run: |
set -eux
mkdir -p _site/playground
# Static landing page + assets
cp site/index.html _site/
cp site/downloads.html _site/ || true
cp -r site/files _site/files
# Playground: vendor web/examples/ui IDE (no WASM artifacts)
cp -r web/examples/ui/src/* _site/playground/
cp -r web/examples/ui/samples _site/playground/samples 2>/dev/null || true
cp site/playground/index.html _site/playground/index.html
cp site/playground/forge-skin.css _site/playground/
# Forge playground scripts (init shim + tabs + share + splitter).
# Glob so future playground-*.js additions land automatically.
cp site/playground/playground-*.js _site/playground/
# Blog + news (template change validation). Match the production
# site-url so feed.xml output matches what pages.yml would emit.
python3 site/blog/build_blog.py \
--posts site/blog/_posts \
--news site/_news \
--template site/blog/template.html \
--site-url https://daslang.io \
--out _site/
touch _site/.nojekyll
ls _site _site/playground
- name: "Install Playwright"
working-directory: site/tests/playground
run: |
npm ci
npx playwright install --with-deps chromium
- name: "Serve _site and run tests"
working-directory: site/tests/playground
run: |
set -eux
python3 -m http.server 8765 --directory "${GITHUB_WORKSPACE}/_site" &
SERVER_PID=$!
# Wait for server to accept connections.
for _ in $(seq 1 30); do
if curl -fs http://localhost:8765/playground/ > /dev/null; then break; fi
sleep 0.2
done
BASE_URL=http://localhost:8765 npx playwright test --grep-invert '@wasm'
STATUS=$?
kill $SERVER_PID || true
exit $STATUS
- name: "Upload Playwright report on failure"
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: site/tests/playground/playwright-report/
retention-days: 7