Skip to content

Build

Build #1199

Workflow file for this run

# This workflow will install the python package and dependencies, and run tests against a variety of Python versions
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 13 * * *" # Every day at 1pm UTC (6am PST)
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cut cookies
run: |
python -m pip install cookiecutter
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
cookiecutter --no-input --overwrite-if-exists .
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
cd example_python_project
python -m pip install ".[dev]" # install package + test dependencies
- name: About
run: |
cd example_python_project
python -m example_python_project.about
- name: Test with pytest
run: |
cd example_python_project
python -m pytest --cov --cov-fail-under 100
- name: Lint ruff
run: |
python -m ruff check example_python_project hooks
- name: Typecheck with mypy
run: |
cd example_python_project
python -m mypy example_python_project
- name: Build documentation with sphinx
run: |
cd example_python_project
sphinx-build -M html docsrc docsrc/_build