Skip to content

Commit

Permalink
ci: update GitHub Actions Python package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmhoffman committed Jun 2, 2023
1 parent 32decc0 commit a708c57
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ master ]
branches: [ $default-branch ]
pull_request:
branches: [ master ]
branches: [ $default-branch ]

jobs:
build-unix:
build:

strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: [3.6, 3.7, 3.8]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]

runs-on: "${{ matrix.os }}"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pep8-naming flake8-docstrings flake8-mypy mypy
python -m pip install --upgrade pip flake8 pep8-naming flake8-builtins flake8-bugbear flake8-import-order flake8-quotes flake8-docstrings flake8-mypy mypy
- name: Lint with flake8
run: |
# 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
flake8 . --count --exit-zero --max-complexity=10 --statistics
build-windows:
# remove flake8-mypy to avoid its bug:
# `re.error: incomplete escape \U at position 72 (line 4, column 3)`

strategy:
matrix:
os: ["windows-latest"]
python-version: [3.6, 3.7, 3.8]

runs-on: "${{ matrix.os }}"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pep8-naming flake8-docstrings
- name: Lint with flake8
run: |
# 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
flake8 . --count --exit-zero --max-complexity=10 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

0 comments on commit a708c57

Please sign in to comment.