Skip to content

397 standardise docstrings #621

397 standardise docstrings

397 standardise docstrings #621

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Development tests
on:
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
pull-requests: write
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.9', '3.10' ]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Display installed pip packages
run: |
pip list
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- 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. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
set -Eeuxo pipefail
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hazenlib tests/ | tee pytest-coverage.txt ; echo $?
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml