Files
AnyPS5/.github/workflows/web-tests.yml
T
MarcZX10 c1edd76407 ci(web-tests): run the archive reserved-name test on pull requests
demo/web/tests/archive-reserved.test.mjs checks that archive.mjs refuses
reserved Windows device names such as COM1 and LPT3, including the
superscript digit forms. Like the Windows path test, it ran only through
tools/test_web.py on tag pushes. Run it in the web-tests job with the same
zip library.

Checked locally on upstream main: the test exits 0 with the variables the
fetch step publishes.
2026-10-31 21:55:15 +00:00

50 lines
2.0 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: Fetch the zip library for the archive tests
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"
echo "ANYPS5_TEST_ZIP_URL=$zip_url" >> "$GITHUB_ENV"
echo "ANYPS5_TEST_ZIP_PATH=$(python3 -c 'from pathlib import Path; import sys; print(Path(sys.argv[1]).resolve().as_uri())' "$RUNNER_TEMP/zip.mjs")" >> "$GITHUB_ENV"
- name: Test archive root selection
run: node demo/web/tests/archive-root.test.mjs demo/web
- name: Test archive Windows paths
run: node demo/web/tests/archive-windows.test.mjs demo/web
- name: Test archive reserved names
run: node demo/web/tests/archive-reserved.test.mjs demo/web
- name: Check browser module syntax
run: |
node --check demo/web/app.mjs
node --check demo/web/archive.mjs
node --check demo/web/batch.mjs
node --check demo/web/failure-report.mjs
node --check demo/web/output-directory.mjs
node --check demo/web/worker.mjs
- name: Test browser converter helpers
run: node --test demo/web/tests/app.test.mjs demo/web/tests/batch.test.mjs demo/web/tests/failure-report.test.mjs demo/web/tests/output-directory.test.mjs
- name: Test directory writer resources
run: node --test demo/web/tests/directory-writer.test.mjs