Add pre-commit and coverage to Github workflow #2
Workflow file for this run
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
name: Unit Tests | |
on: | |
pull_request: | |
branches: | |
- master | |
types: | |
- opened | |
- synchronize | |
- closed | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install Dependencies | |
run: | | |
pip install -e . | |
pip install -r requirements.txt | |
pre-commit install | |
- name: Run Unit Tests | |
run: coverage run -m pytest -s tests | |
- name: Test Coverage | |
# TODO: Change this after finishing tests. | |
run: coverage report --fail-under=94 | |
- name: Run Pre-Commit Hooks | |
run: pre-commit run --all-files |