Skip to content

chore: add ruff, mypy, pytest-cov and build to dev group. Bump versio… #2

chore: add ruff, mypy, pytest-cov and build to dev group. Bump versio…

chore: add ruff, mypy, pytest-cov and build to dev group. Bump versio… #2

Workflow file for this run

name: CI (Poetry)
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Cache venv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-py311-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py311-
- name: Install deps (dev/test groups if present)
run: |
if poetry install --no-interaction --with dev,test; then
echo "Installed with groups dev,test"
else
poetry install --no-interaction
fi
- name: Ruff
run: poetry run ruff check .
typecheck:
name: typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-py311-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py311-
- name: Install deps
run: |
if poetry install --no-interaction --with dev,test; then
echo "Installed with groups dev,test"
else
poetry install --no-interaction
fi
- name: mypy
run: |
poetry run mypy src || poetry run mypy .
tests:
name: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-py311-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py311-
- name: Install deps
run: |
if poetry install --no-interaction --with dev,test; then
echo "Installed with groups dev,test"
else
poetry install --no-interaction
fi
- name: pytest
run: poetry run pytest -q
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-py311-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py311-
- name: Install deps (no root)
run: |
if poetry install --no-interaction --with dev,test; then
echo "Installed with groups dev,test"
else
poetry install --no-interaction
fi
- name: Build package
run: poetry build