Skip to content

Build

Build #886

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: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 13 * * *" # Every day at 1pm UTC (6am PST)
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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 $(python -Wi setup.py --name).about
- name: Test with pytest
run: |
cd example_python_project
python -m pytest --cov --cov-fail-under 100
- name: Lint with black and isort (run `make delint` to fix issues)
run: |
python -m black --check example_python_project hooks
python -m isort --check example_python_project hooks
- name: Lint with flake8
run: |
cd example_python_project
python -m flake8 .
- name: Typecheck with mypy
run: |
cd example_python_project
python -m mypy
- name: Build documentation with sphinx
run: |
cd example_python_project
sphinx-build -M html docsrc docsrc/_build