build #246
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
# When the 'permissions' key is specified, unspecified permission scopes (e.g., | |
# actions, checks, etc.) are set to no access (none). | |
permissions: | |
contents: read | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
# Run weekly (* is a special character in YAML, so quote the string) | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
inputs: | |
# When git-ref is empty, HEAD will be checked out. | |
git-ref: | |
description: Optional git ref (branch, tag, or full SHA) | |
required: false | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
exclude: | |
# Python 3.6 is not supported on GitHub-hosted Ubuntu runners as of | |
# Ubuntu 22.04. | |
# https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 | |
- os: ubuntu-latest | |
python-version: '3.6' | |
# python<=3.7 is not supported on GitHub-hosted macOS runners as of macOS 14. | |
# https://github.com/actions/runner-images/issues/9770 | |
- os: macos-latest | |
python-version: '3.6' | |
- os: macos-latest | |
python-version: '3.7' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# When the ref is empty, HEAD will be checked out. | |
ref: ${{ github.event.inputs.git-ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Lint | |
run: | | |
pip install flake8 | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Install | |
run: pip install . | |
- name: Test | |
run: | | |
cd tests # so package is imported from site-packages instead of working directory | |
python -m unittest discover . -v |