mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-07-21 12:21:03 +02:00
Attempt to fix the package version bug by fetching the entire repo in the package build workflow. This should get the tag so it can be used when setting the version. Closes #106.
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
---
|
|
|
|
name: PR Check
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- 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: SKIP=no-commit-to-branch pre-commit run --all-files
|
|
|
|
python-tests:
|
|
needs: pre-commit
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0 # Fetch the entire history including tags
|
|
|
|
- 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
|
|
|
|
- name: CLI tests
|
|
run: docker/test/shell_tests.sh
|