add CI workflow

This commit is contained in:
2026-03-30 00:02:53 -07:00
parent 4ba9f43e30
commit 11d9147808
3 changed files with 107 additions and 1 deletions

75
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
name: Build
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
label: macOS
build_cmd: bash scripts/build-mac.sh
artifact_path: desktop-dist/tono.dmg
artifact_name: tono-macos
- os: ubuntu-latest
label: Linux
build_cmd: bash scripts/build-linux.sh
artifact_path: desktop-dist/tono-linux.tar.gz
artifact_name: tono-linux
- os: windows-latest
label: Windows
build_cmd: npm run build:windows
artifact_path: desktop-dist/tono
artifact_name: tono-windows
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.label }})
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
# Build scripts call `uv pip install` for Python deps
- name: Install uv
run: pip install uv
# Linux: pywebview needs webkit2gtk headers to import during PyInstaller collection
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -y \
python3-gi python3-gi-cairo \
gir1.2-gtk-3.0 \
libwebkit2gtk-4.1-dev \
gir1.2-webkit2-4.1
- name: Install Node dependencies
run: npm install
- name: Build
run: ${{ matrix.build_cmd }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_path }}
if-no-files-found: error

31
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Tests
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- name: Install Python dependencies
run: pip install -e ".[dev]"
- name: Install Node dependencies
run: npm install
- name: Run tests
run: python -m pytest -q

2
.gitignore vendored
View File

@@ -3,6 +3,7 @@
*.DS_Store
.pytest_cache/
.coverage
.claude/
pytest-cache-files-*/
desktop-build/
desktop-dist/
@@ -10,5 +11,4 @@ frontend/node_modules/
frontend/dist/
.venv/
sessions/
.*/
frontend/coverage/