ci: update repo structure and CI/CD for v2 #540
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |