Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Adds support for grouped dependabot updates (#82) #71

Adds support for grouped dependabot updates (#82)

Adds support for grouped dependabot updates (#82) #71

Workflow file for this run

name: Tests
on:
workflow_dispatch:
workflow_call:
push:
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Checkout source
uses: actions/checkout@v3
- name: Install package dependencies
run: poetry install --with tests
- name: Run tests with coverage
run: |
coverage run -m unittest discover
coverage report --omit="tests/*"
coverage xml --omit="tests/*" -o report_${{ matrix.python-version }}.xml
# Report test coverage to codacy for the python version being tested
- name: Report partial coverage results
if: github.event_name != 'release'
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r report_${{ matrix.python-version }}.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# Use this job for branch protection rules
report-test-status:
name: Report Test Status
runs-on: ubuntu-latest
needs: run-tests
if: always()
steps:
- name: Check build status
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
# Tell codacy we are done reporting test coverage
report-code-coverage:
name: Report Coverage
runs-on: ubuntu-latest
needs: run-tests
if: github.event_name != 'release'
steps:
- name: Finish reporting coverage
shell: bash
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}