chore: Add github workflows

Add github workflows for running pre-commit hooks on all files and
running pytests.
This commit is contained in:
Jon Grace-Cox
2024-12-30 06:57:03 -05:00
committed by Jon Grace-Cox
parent 9d4470a1a0
commit bb9ef961fb
2 changed files with 63 additions and 0 deletions

29
.github/workflows/pre_commit_check.yaml vendored Normal file
View File

@@ -0,0 +1,29 @@
---
name: Pre-commit hooks
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r build-requirements.txt
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

34
.github/workflows/python_checks.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Python tests
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r build-requirements.txt
- name: Build package
run: python setup.py bdist_wheel
- name: Install package
run: pip install dist/*.whl
- name: Run tests
run: pytest --doctest-modules --cov=anybadge --cov-report term --cov-report xml:coverage.xml --cov-report html:htmlcov anybadge tests