2bafb1b99b
Consolidates sane flake8 settings to pyproject with the Flake8-pyproject plugin. Does not change logic of test workflow but allows base settings to live in pyproject for anyone using flake8 as an external linter (e.g. vscode) Also fixes some flake8 errors that were not being picked up by current testing, mostly unused imports.
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
name: Python Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, development ]
|
|
paths-ignore:
|
|
- "*.md"
|
|
pull_request:
|
|
branches: [ master, development ]
|
|
paths-ignore:
|
|
- "*.md"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python-version: [3.9]
|
|
ext: [.sh]
|
|
include:
|
|
- os: windows-latest
|
|
python-version: 3.9
|
|
ext: .ps1
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip Flake8-pyproject pytest pytest-cov
|
|
pip install .
|
|
|
|
- name: Make configuration for tests
|
|
env:
|
|
REDDIT_TOKEN: ${{ secrets.REDDIT_TEST_TOKEN }}
|
|
run: |
|
|
./devscripts/configure${{ matrix.ext }}
|
|
|
|
- name: Lint with flake8
|
|
run: |
|
|
flake8 . --select=E9,F63,F7,F82
|
|
|
|
- name: Test with pytest
|
|
run: |
|
|
pytest -m 'not slow' --verbose --cov=./bdfr/ --cov-report term:skip-covered --cov-report html
|
|
|
|
- name: Upload coverage report
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: coverage_report
|
|
path: htmlcov/
|