- test.yml: use uv venv instead of pip --break-system-packages - release.yml: inline test job that must pass before version bump; only triggers on source file changes (src/, src-tauri/, package.json) - sidecar-release.yml: inline Python test job that must pass before sidecar version bump - Both coordinators use `needs: test` so builds never start if tests fail Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
python-tests:
|
|
name: Python Backend Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
run: |
|
|
if command -v uv &> /dev/null; then
|
|
echo "uv already installed: $(uv --version)"
|
|
else
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
fi
|
|
|
|
- name: Run pytest
|
|
run: |
|
|
uv venv .testvenv
|
|
VIRTUAL_ENV=.testvenv uv pip install pytest httpx pytest-asyncio anyio fastapi pydantic pyyaml uvicorn requests
|
|
.testvenv/bin/python -m pytest backend/tests/ client/tests/ -v --tb=short
|
|
|
|
frontend-tests:
|
|
name: Frontend 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
|
|
|
|
- name: Run Vitest
|
|
run: npx vitest run
|
|
|
|
rust-tests:
|
|
name: Rust Sidecar Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install Tauri system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Run cargo test
|
|
working-directory: src-tauri
|
|
run: cargo test
|