Skip to content

v14.1.8 (#39)

v14.1.8 (#39) #66

Workflow file for this run

name: CI
on:
push:
branches: [main, grok]
pull_request:
branches: [main]
permissions:
checks: write
contents: read
actions: read
pull-requests: write
jobs:
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev
- name: Install Ruff
run: pip install ruff
- name: Run Ruff Linter
run: ruff check .
- name: Run Ruff Formatter Check
run: ruff format --check .
test:
name: Python ${{ matrix.python-version }} Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev
- name: Install test dependencies
run: poetry run pip install pytest-cov pytest-github-actions-annotate-failures
- name: Run tests with pytest
run: |
mkdir -p junit
poetry run pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=sakit --cov-report=xml --cov-report=term tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: "Test Results"
files: junit/test-results-${{ matrix.python-version }}.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.python-version }}
path: junit/*.xml
- name: Create Status Check
uses: LouisBrunner/checks-action@v2.0.0
if: always()
with:
token: ${{ github.token }}
name: "Python Tests"
conclusion: ${{ job.status }}
output: |
{"summary":"Python ${{ matrix.python-version }} test results"}