Bump actions/setup-python from 4 to 5 #120
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
# 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 | |
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: ${{ matrix.os }} (py ${{ matrix.python-version }}${{ matrix.special }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: False | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
special: [''] | |
include: | |
- os: ubuntu-20.04 | |
special: '' | |
python-version: "3.6" | |
- os: ubuntu-latest | |
special: '; pre-release' | |
python-version: "3.11" | |
- os: ubuntu-latest | |
special: '; no-optional' | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
case "${{ matrix.special }}" in | |
'; no-optional') | |
pip install -e .[test_no_optional] ;; | |
'; pre-release') | |
pip install --pre -e .[test] --upgrade --force-reinstall ;; | |
*) | |
pip install -e .[test] ;; | |
esac | |
- name: Python info | |
run: | | |
which python | |
python --version | |
- name: Installed packages | |
run: pip list | |
- name: Test with pytest | |
shell: bash | |
run: | | |
case "${{ matrix.special }}" in | |
'; no-optional') | |
pytest ;; | |
*) | |
pytest --doctest-modules ;; | |
esac | |
- name: Run codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
name: codecov-umbrella | |
Linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python on ubuntu-latest | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install linters | |
run: | | |
pip install flake8 pydocstyle mypy | |
pip install --pre -e .[test] --upgrade | |
- name: Python info | |
run: | | |
which python | |
python --version | |
- name: Installed packages | |
run: pip list | |
- name: Run flake8 | |
run: flake8 docs assertionlib tests | |
- name: Run pydocstyle | |
run: pydocstyle assertionlib | |
- name: Run mypy | |
run: mypy assertionlib tests |