Skip to content

[pull] master from GaijinEntertainment:master #3

[pull] master from GaijinEntertainment:master

[pull] master from GaijinEntertainment:master #3

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/ui/**'
- '.github/workflows/playground-e2e.yml'
push:
branches-ignore: [master]
paths:
- 'site/**'
- 'web/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/ui IDE (no WASM artifacts)
cp -r web/ui/src/* _site/playground/
cp -r web/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