Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ jobs:
- uses: astral-sh/setup-uv@v6
- name: Build
run: sh packaging/build.sh
- name: Libraries Firefox needs (for the smoke test)
if: runner.os == 'Linux'
run: sudo packaging/build/venv/bin/python -m playwright install-deps firefox
- name: Smoke test
# Linux: first without installing Firefox's system libraries (GitHub's runners ship Firefox, so they have them;
# apt can take 20+ minutes when Ubuntu's mirror is slow); if it fails, they are installed and it runs once more
run: |
if [ "$RUNNER_OS" = Linux ]; then APP="$(ls dist/*.AppImage)"; else APP=packaging/build/dist/NUauto.app/Contents/MacOS/NUauto; fi
packaging/build/venv/bin/python packaging/smoke.py "$APP"
if ! packaging/build/venv/bin/python packaging/smoke.py "$APP"; then
[ "$RUNNER_OS" = Linux ] || exit 1
echo "Smoke test failed: installing the system libraries Firefox needs, then once more"
sudo packaging/build/venv/bin/python -m playwright install-deps firefox
packaging/build/venv/bin/python packaging/smoke.py "$APP"
fi
- uses: actions/upload-artifact@v4
with:
name: nuauto-${{ matrix.os }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ jobs:
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python -e .
- name: Install Playwright's Firefox
run: .venv/bin/python -m playwright install --with-deps firefox
# GitHub's Linux runners ship Firefox, so they already have the system libraries it needs; they are installed
# (apt, which can take 20+ minutes when Ubuntu's mirror is slow) only if Firefox does not start without them
run: |
.venv/bin/python -m playwright install firefox
if [ "$RUNNER_OS" = Linux ] && ! .venv/bin/python - <<'EOF'
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
p.firefox.launch().close()
EOF
then
echo "Firefox did not start: installing the system libraries it needs"
sudo .venv/bin/python -m playwright install-deps firefox
fi
- name: Tests
run: .venv/bin/nuauto test
3 changes: 2 additions & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ REPO LAYOUT (what is not a module)
deploy/systemd/ (homelab units: daily, weekly, intern, deploy, assist timers + services; web service)
packaging/ (the packaged app: nuauto.spec, build.sh, distros.sh, entry.py, AppRun, desktop file, icons, smoke.py)
.github/workflows/ (tests.yml: `nuauto test` on Ubuntu + macOS, on PRs and main; release.yml: AppImages + DMGs, built on
PRs (Intel Mac: tags only), released on v* tags)
PRs (Intel Mac: tags only), released on v* tags. Firefox's system libraries are installed on Linux only when Firefox
won't start without them: GitHub's runners already have them, and apt can take 20+ minutes on a slow Ubuntu mirror)

TESTS (`nuauto test` runs every tests/test_*.py, 4 at a time: offline, no sheet, no real NUworks, no network; browser tests
use headless Firefox on local pages or demo mode. Run it before pushing; CI runs it on Ubuntu and macOS.)
Expand Down
Loading