Skip to content

ci: add electron-tests job, run full integration suite, gate releases… #172

ci: add electron-tests job, run full integration suite, gate releases…

ci: add electron-tests job, run full integration suite, gate releases… #172

Workflow file for this run

name: CI
on:
push:
branches: [master, main]
tags:
- "v*"
pull_request:
branches: [master, main]
permissions:
contents: write
jobs:
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: backend/requirements-test.txt
- run: pip install -r requirements-test.txt
- name: Python lint (ruff)
run: |
pip install "ruff>=0.4"
ruff check app
- run: python -m pytest tests/unit/ -v --tb=short
# Run the WHOLE integration suite, not just one file (test_aws_integration.py
# was previously never executed in CI).
- run: python -m pytest tests/integration/ -v --tb=short
- run: python -m pytest tests/e2e/ -v --tb=short --run-e2e
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
- run: npm run lint
- run: npx tsc --noEmit
- run: npm test -- --run --reporter=verbose
electron-tests:
name: Electron Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
# vitest runs the electron tests under Node, but postinstall
# (electron-builder install-app-deps) rebuilds better-sqlite3 for the
# Electron ABI. Rebuild it for the Node ABI so the DB-backed tests load.
- name: Rebuild native deps for Node ABI
run: npm rebuild better-sqlite3
- name: Run electron test suite
run: npm run test:scheduler
build:
name: Build
runs-on: ubuntu-latest
needs: [backend-tests, lint-and-test]
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
- run: npm run build
release:
name: Release Windows Installer
runs-on: windows-latest
# All test suites + build must pass before we cut a release. electron-tests
# gates here because the desktop app IS the shipped Windows/macOS artifact.
needs: [backend-tests, lint-and-test, electron-tests, build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install root dependencies
run: npm install
- name: Install frontend dependencies
run: cd frontend && npm ci
- name: Build and publish
run: npm run publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-mac:
name: Release macOS DMG
runs-on: macos-latest
# Serialized after the Windows release job so both publish into ONE draft
# release: 'release' creates the draft + uploads the .exe, then 'release-mac'
# finds that draft and uploads the .dmg. Avoids the split-draft race.
needs: [backend-tests, lint-and-test, electron-tests, build, release]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install root dependencies
run: npm install
- name: Install frontend dependencies
run: cd frontend && npm ci
- name: Build and publish
run: npm run publish:mac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}