name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv and create venv
run: |
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Ensure it's in the path
export PATH="$HOME/.cargo/bin:$PATH"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# Create and activate virtual environment
uv venv
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv pip install -e ".[dev]"
- name: Run tests with pytest
run: |
source .venv/bin/activate
pytest --cov=src --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false