Skip to content

CI

CI #173

Workflow file for this run

# This workflow runs the repo's CI tests.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: 5 4 * * 1 # every monday at 04:05 UTC
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
ci:
name: Python ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
defaults:
run:
shell: bash -elo pipefail {0}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: pyproject.toml
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install OSMnx
run: |
uv python pin ${{ matrix.python-version }}
uv sync --all-extras --group docs --group lint --group test
- name: Cache pre-commit
uses: actions/cache@v5
with:
path: ~/.cache/prek/
key: pre-commit-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit checks
run: uv run prek run --all-files
env:
SKIP: no-commit-to-branch
- name: Build and check package
run: |
uv build
uv run twine check --strict dist/*
uv run validate-pyproject ./pyproject.toml
- name: Test docs build
run: uv run sphinx-build -E -W --keep-going -b html ./docs/source ./docs/build/html
- name: Test code and coverage
run: uv run pytest --typeguard-packages=osmnx --cov=osmnx --cov-report=xml
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}