Files
AnyPS5/.github/workflows/web-tests.yml
T

38 lines
1.3 KiB
YAML

name: Web tests
on:
pull_request:
paths:
- .github/workflows/web-tests.yml
- demo/web/**
- tools/test_web.py
permissions:
contents: read
concurrency:
group: web-tests-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
output-directory:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Test archive root selection
shell: bash
run: |
zip_url=$(python3 -c 'from pathlib import Path; import re; print(re.search(r"from \"(https://cdn.jsdelivr.net/[^\"]+)\"", Path("demo/web/archive.mjs").read_text(encoding="utf-8")).group(1))')
curl -fsSL "$zip_url" -o "$RUNNER_TEMP/zip.mjs"
ANYPS5_TEST_ZIP_URL="$zip_url" ANYPS5_TEST_ZIP_PATH="$(python3 -c 'from pathlib import Path; import sys; print(Path(sys.argv[1]).resolve().as_uri())' "$RUNNER_TEMP/zip.mjs")" node demo/web/tests/archive-root.test.mjs demo/web
- name: Check browser module syntax
run: |
node --check demo/web/app.mjs
node --check demo/web/output-directory.mjs
node --check demo/web/worker.mjs
- name: Test folder output recovery
run: node --test demo/web/tests/output-directory.test.mjs