Skip to content

Feature/telegram bot #13

Feature/telegram bot

Feature/telegram bot #13

Workflow file for this run

---
name: Testing
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
Testing:
runs-on: ubuntu-latest
steps:
# check-out repo
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# install poetry
- name: Install poetry
run: pipx install poetry==1.6.0
# set-up python with cache
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
# install requirements
- name: Install requirements
run: poetry install --with test
# run unit tests
- name: Run unit tests
run: |
set -o pipefail
poetry run make unit-tests-cov-fail
# add pytest coverage report to PR
- name: Pytest coverage comment
if: ${{ success() && github.event_name == 'pull_request' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
title: Coverage Report
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
# add content to GitHub summary
- name: Pytest coverage Github summary
if: ${{ success() && github.event_name == 'pull_request' }}
run: |
set -o pipefail
echo '# Coverage report :rocket:' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat pytest-coverage.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '\n\n\n'
echo '${{ steps.coverageComment.outputs.coverageHtml }}' >> $GITHUB_STEP_SUMMARY