mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
name: Safari WebSpeak3 client check
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "web/src/**"
|
|
- "web/index.html"
|
|
- "web/public/**"
|
|
- ".github/workflows/safari-check.yml"
|
|
- "tests/safari_smoke.py"
|
|
schedule:
|
|
- cron: "17 5 * * 1"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: safari-landing-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
safari:
|
|
name: Safari on macOS
|
|
runs-on: macos-15
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install and build WebSpeak3 client
|
|
working-directory: web
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Start local preview
|
|
working-directory: web
|
|
run: |
|
|
npm run preview -- --host 127.0.0.1 --port 4173 > /tmp/webspeak3-preview.log 2>&1 &
|
|
for attempt in {1..30}; do
|
|
curl --fail --silent http://127.0.0.1:4173/ > /dev/null && exit 0
|
|
sleep 1
|
|
done
|
|
cat /tmp/webspeak3-preview.log
|
|
exit 1
|
|
|
|
- name: Prepare Safari automation
|
|
run: |
|
|
sudo safaridriver --enable
|
|
python3 -m venv .venv-safari
|
|
.venv-safari/bin/python -m pip install selenium
|
|
|
|
- name: Test WebSpeak3 client in Safari
|
|
env:
|
|
BASE_URL: http://127.0.0.1:4173/
|
|
run: .venv-safari/bin/python tests/safari_smoke.py
|
|
|
|
- name: Upload Safari screenshots
|
|
if: always()
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: safari-client-screenshots
|
|
path: test-results/safari-client-*.png
|
|
if-no-files-found: ignore
|
|
retention-days: 14
|