Bump actions/upload-artifact from 3 to 4 #248
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: ${{ matrix.os }} (py ${{ matrix.version }}${{ matrix.special }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
special: [''] | |
include: | |
- os: ubuntu-latest | |
special: '; pre-release' | |
version: '3.11' | |
- os: ubuntu-latest | |
special: '; no-optional' | |
version: '3.11' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install dependencies | |
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 | |
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 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python on ubuntu-latest | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install linters | |
run: pip install -e .[lint] | |
- name: Python info | |
run: | | |
which python | |
python --version | |
- name: Installed packages | |
run: pip list | |
- name: Run flake8 | |
run: flake8 nanoutils docs tests | |
- name: Run pydocstyle | |
run: pydocstyle nanoutils | |
- name: Run mypy | |
run: mypy nanoutils |