Update ruff target version #18
This file contains 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: tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
CODECOV_TOKEN: | |
required: true # Ensures CODECOV_TOKEN is required for this workflow | |
jobs: | |
CI: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: chartboost/ruff-action@v1 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install the project | |
run: uv sync --group dev | |
- name: Check types | |
run: | | |
uv run mypy src/blacksmith/ | |
- name: Run tests | |
run: | | |
uv run pytest tests --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=blacksmith --cov-report=xml --cov-report=html | |
- name: Upload pytest test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: junit/test-results-${{ matrix.python-version }}.xml | |
- name: Codecov | |
if: matrix.python-version == '3.12' && github.event_name != 'workflow_dispatch' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml |