Setup initial CI gating on tests and add linting tests (#85)

* add flake, black, mypy, and bandit to run

* fixes issues flake and black complained about

* make mypy run successfully, add configuration files rather than specifying in ci

* respond to feedback

* configure bandit, ignore a file used only in local development
This commit is contained in:
Logan McDonald 2022-08-26 12:36:02 -04:00 committed by GitHub
parent e288578028
commit 8f41050f76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 124 additions and 71 deletions

35
.github/workflows/test.yaml vendored Normal file
View file

@ -0,0 +1,35 @@
# test.yml
name: Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
python-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install bandit black flake8 mypy types-requests
- name: Lint with flake8
working-directory: ./src
run: flake8 . --count --show-source --statistics
- name: Check formatting with black
working-directory: ./src
run: black --check .
- name: Run type checking
working-directory: ./src
run: mypy .
- name: Run bandit security scanning
working-directory: ./src
run: bandit -r .