Skip to content

ci: update repo structure and CI/CD for v2 #540

ci: update repo structure and CI/CD for v2

ci: update repo structure and CI/CD for v2 #540

Workflow file for this run

name: CI Pytest
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Run and write pytest
run: |
pip install --editable .
pytest --cov=src --cov-report term-missing
pytest-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.10
- name: Install dependencies
run: |
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Run and write pytest
run: |
pip install --editable .
set -o pipefail
pytest --cov=src --cov-report term-missing | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverage-comment
uses: MishaKav/pytest-coverage-comment@v1.1.25
with:
pytest-coverage-path: ./pytest-coverage.txt
github-token: ${{ secrets.PYTEST_COVERAGE }}
- name: Check the output coverage
if: ${{ github.event_name == 'push' }}
run: |
echo "Coverage Report - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverage-comment.outputs.color }}"
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.PYTEST_COVERAGE }}
gistID: ce7ccaf6aaa9faeeba83f9b61b5cfcd8
filename: badge-dfm-pytest-coverage.json
label: Coverage
message: ${{ steps.coverage-comment.outputs.coverage }}
color: ${{ steps.coverage-comment.outputs.color }}
namedLogo: python