diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cab9db3 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8d619fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.gitignore b/.gitignore index c4e5061..69ffd2f 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ \ No newline at end of file