70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
schedule:
|
|
- cron: "0 9 * * 1" # weekly Monday 9am
|
|
|
|
jobs:
|
|
install:
|
|
runs-on: ubuntu-latest
|
|
container: python:3.13-slim
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install system dependencies
|
|
run: apt-get update -qq && apt-get install -y -qq libcap-dev
|
|
|
|
- name: Install Poetry
|
|
run: pip install poetry==2.1.1
|
|
|
|
- name: Install dependencies
|
|
run: poetry install --without pi --no-interaction
|
|
|
|
- name: Cache venv
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ hashFiles('pyproject.toml') }}
|
|
|
|
black:
|
|
runs-on: ubuntu-latest
|
|
container: python:3.13-slim
|
|
needs: install
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: pip install poetry==2.1.1
|
|
- run: poetry run black --check src/ tests/
|
|
|
|
ruff:
|
|
runs-on: ubuntu-latest
|
|
container: python:3.13-slim
|
|
needs: install
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: pip install poetry==2.1.1
|
|
- run: poetry run ruff check src/ tests/
|
|
|
|
mypy:
|
|
runs-on: ubuntu-latest
|
|
container: python:3.13-slim
|
|
needs: install
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: pip install poetry==2.1.1
|
|
- run: poetry run mypy src/
|
|
|
|
pytest:
|
|
runs-on: ubuntu-latest
|
|
container: python:3.13-slim
|
|
needs: install
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: apt-get update -qq && apt-get install -y -qq libcap-dev
|
|
- run: pip install poetry==2.1.1
|
|
- run: poetry install --without pi --no-interaction
|
|
- run: poetry run pytest
|