Skip to content

[pre-commit.ci] pre-commit autoupdate #559

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #559

Workflow file for this run

# 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: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
name: "Python ${{ matrix.python-version }} on Ubuntu"
runs-on: "ubuntu-latest"
env:
USING_COVERAGE: "3.7,3.8,3.9,3.10"
strategy:
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
steps:
- uses: "actions/checkout@v3"
- uses: "actions/[email protected]"
with:
python-version: "${{ matrix.python-version }}"
- name: "Get pip cache dir"
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: "Cache"
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel virtualenv tox tox-gh-actions pytest-xdist
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: "Run tox targets for ${{ matrix.python-version }}"
run: "python -m tox"
- name: "Upload coverage to Codecov"
if: "contains(env.USING_COVERAGE, matrix.python-version)"
uses: "codecov/codecov-action@v3"
with:
name: Python ${{ matrix.python-version }}
file: ./coverage.xml
files: ./coverage1.xml,./coverage2.xml
fail_ci_if_error: true
verbose: true