mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-07-21 20:31:03 +02:00
chore: Add github workflows
Add github workflows for running pre-commit hooks on all files and running pytests.
This commit is contained in:
committed by
Jon Grace-Cox
parent
9d4470a1a0
commit
bb9ef961fb
29
.github/workflows/pre_commit_check.yaml
vendored
Normal file
29
.github/workflows/pre_commit_check.yaml
vendored
Normal 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
34
.github/workflows/python_checks.yaml
vendored
Normal 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
|
Reference in New Issue
Block a user