[pre-commit.ci] pre-commit autoupdate #92
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
--- | |
# https://docs.github.com/en/actions/guides/building-and-testing-python | |
name: Python Lint | |
# Uncomment if you assumeZZk: Assumes python files are in ./python or pushes to main | |
on: | |
push: | |
branches: | |
- master | |
- main | |
#paths: | |
- 'python/**' | |
pull_request: | |
#paths: | |
#- 'python/**' | |
jobs: | |
python: | |
#runs-on: ubuntu-latest | |
runs-on: ubuntu-20.04 | |
# Note with this version testing you do not need tox in the cloud | |
strategy: | |
matrix: | |
# 3.7 will not run with the current requirements.txt pinning | |
python-version: [ 3.8, 3.9 ] | |
steps: | |
# checkout repo under $GITHUB_WORKSPACE | |
- name: Checkout action | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
submodules: recursive | |
# install latest python version | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
run: python --version | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
# Ubuntu specific path | |
path: ~/.cache/pip | |
# https://github.com/actions/cache/blob/main/examples.md#python---pip | |
# See if there is a cache hit looking for the requirements.txt | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
# assumes python in in the subdirectory ./python | |
- name: Test with pytest | |
run: | | |
pip install pytest pytest-cov | |
cd python | |
pytest --cov=. --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html |