| 1 |
name: Python CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
paths-ignore: |
| 8 |
- "**.md" |
| 9 |
pull_request: |
| 10 |
branches: |
| 11 |
- main |
| 12 |
|
| 13 |
jobs: |
| 14 |
build: |
| 15 |
strategy: |
| 16 |
matrix: |
| 17 |
os: [ubuntu-latest, windows-latest] |
| 18 |
python: ["3.9", "3.13"] |
| 19 |
runs-on: ${{ matrix.os }} |
| 20 |
timeout-minutes: 10 |
| 21 |
|
| 22 |
steps: |
| 23 |
- name: Checkout |
| 24 |
uses: actions/checkout@v4 |
| 25 |
|
| 26 |
- name: Install uv |
| 27 |
uses: astral-sh/setup-uv@v6 |
| 28 |
with: |
| 29 |
enable-cache: true |
| 30 |
python-version: ${{ matrix.python }} |
| 31 |
|
| 32 |
- name: Install dependencies |
| 33 |
run: uv sync --group dev |
| 34 |
|
| 35 |
- name: Lint with ruff |
| 36 |
if: startsWith(matrix.os, 'ubuntu') |
| 37 |
run: | |
| 38 |
uv run ruff check . |
| 39 |
uv run ruff format --check . |
| 40 |
|
| 41 |
- name: Type checking with mypy |
| 42 |
if: startsWith(matrix.os, 'ubuntu') |
| 43 |
run: | |
| 44 |
uv run mypy censys |
| 45 |
|
| 46 |
- name: Test with pytest |
| 47 |
run: | |
| 48 |
uv run pytest --cov --cov-fail-under=100 |