build #353
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, windows-latest, ubuntu-latest] | |
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
exclude: | |
# Python 3.6 is not supported on GitHub hosted runners as of Ubuntu 22.04. | |
# https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 | |
- os: ubuntu-latest | |
python-version: '3.6' | |
# Python versions prior to 3.8 are 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 | |
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 . | |
# On PowerShell, a step does not fail when an intermediate command in a multiline command | |
# fails. Adding '$ErrorActionPreference = "Stop"' didn't resolve the issue. The issue is | |
# avoided by using a separate step for each test command. | |
- name: Run Tests | |
run: python -m unittest discover tests -v | |
- name: Ensure Executable Runs | |
run: vimgolf |