Skip to content

feat: add and refactor system comments - v1 #2195

feat: add and refactor system comments - v1

feat: add and refactor system comments - v1 #2195

Workflow file for this run

name: Continuous Integration
on:
pull_request:
types: [assigned, opened, synchronize, reopened]
jobs:
pytest:
runs-on: ubuntu-latest
environment: CI Environment
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Bring up Services and run tests
run: |
docker compose -f docker-compose-pipeline.yml build
docker compose -f docker-compose-pipeline.yml up -d
docker compose -f docker-compose-pipeline.yml exec -T api pytest tests/ --cov --junit-xml=test-reports/report.xml --cov-report=xml --cov-report=term-missing --cov-fail-under=91 | tee pytest-coverage.txt
echo "STATUS=$(cat pytest-coverage.txt | grep 'Required test' | awk '{ print $1 }')" >> $GITHUB_ENV
echo "FAILED=$(cat test-reports/report.xml | awk -F'=' '{print $5}' | awk -F' ' '{gsub(/"/, "", $1); print $1}')" >> $GITHUB_ENV
env:
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
if: ${{ always() && github.ref != 'refs/heads/master' && github.actor != 'dependabot[bot]' }}
with:
create-new-comment: true
junitxml-path: ./test-reports/report.xml
pytest-coverage-path: ./pytest-coverage.txt
- name: Perform coverage check
shell: bash
run: |
set -o pipefail
python -m pip install diff-cover
git fetch origin master --depth=1
diff-cover coverage.xml --compare-branch=origin/master --diff-range-notation .. --fail-under=90 > result.txt 2>&1
- name: Comment coverage check
if: ${{ always() && github.actor != 'dependabot[bot]' }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: result.txt
- name: Evaluate Coverage
if: ${{ (env.STATUS == 'FAIL') || (env.FAILED > 0) }}
run: exit 1