GOATS-971: add version checker in goats run (#457) #277
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python CI | |
on: | |
pull_request: | |
paths: | |
- "src/**/*.py" | |
- "tests/**/*.py" | |
- "pyproject.toml" | |
- "uv.lock" | |
- ".github/workflows/python_ci.yaml" | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Run linter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Run linter | |
uses: astral-sh/ruff-action@v3 | |
with: | |
version-file: "pyproject.toml" | |
format: | |
name: Check format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Check format | |
uses: astral-sh/ruff-action@v3 | |
with: | |
args: "format --check" | |
version-file: "pyproject.toml" | |
tests: | |
name: Run tests | |
needs: [lint, format] | |
runs-on: [ubuntu-latest] | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Install uv and set the python version | |
uses: astral-sh/setup-uv@v7 | |
with: | |
enable-cache: true | |
cache-dependency-glob: uv.lock | |
python-version: ${{ matrix.python-version }} | |
- name: Install the project | |
run: uv sync --locked --dev --group github | |
- name: Run tests and calculate coverage | |
run: | | |
uv run pytest -r A -v -n auto --cov=src --cov-report=xml --cov=tests --cov-branch | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Minimize uv cache | |
run: uv cache prune --ci |