auto-semver/.github/workflows/unittests.yaml
2023-07-22 04:59:16 -04:00

50 lines
1.1 KiB
YAML

name: Unit Tests
on:
push:
branches:
- master
- feature/refactor
pull_request: {}
jobs:
test:
name: Unit Tests
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.6", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Run Coverage
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=semver | tee pytest-coverage.txt
if: github.event_name == 'pull_request'
- name: Comment Result Summary
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
if: github.event_name == 'pull_request'
- name: Test
run: |
pytest