diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..659d8dc2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,47 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Cancel in-progress runs for the same PR/branch +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + python-version: ['3.11', '3.12'] + fail-fast: false + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install dependencies + run: | + uv venv .venv --python ${{ matrix.python-version }} + source .venv/bin/activate + uv pip install -e ".[all,dev]" + + - name: Run tests + run: | + source .venv/bin/activate + python -m pytest tests/ -q --ignore=tests/integration --tb=short + env: + # Ensure tests don't accidentally call real APIs + OPENROUTER_API_KEY: "" + OPENAI_API_KEY: "" + NOUS_API_KEY: ""