Files
webspeak3/.github/workflows/safari-check.yml

76 lines
2.0 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-client-${{ 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@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # 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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
with:
name: safari-client-screenshots
path: test-results/safari-client-*.png
if-no-files-found: ignore
retention-days: 14