feat: Add extensive loggers #83
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: Continuous Integration | |
on: | |
pull_request: | |
types: [assigned, opened, synchronize, reopened] | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
environment: CI Environment | |
steps: | |
- uses: actions/checkout@v2 | |
continue-on-error: true | |
- name: Run Tests | |
env: | |
SERVER_URL: ${{ secrets.SERVER_URL }} | |
TOKEN_URL: ${{ secrets.TOKEN_URL }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
run: | | |
pip install -r requirements.txt && pip install pytest pytest-coverage | |
python -m pytest test/ --cov=. --junit-xml=test-reports/report.xml --cov-report=term-missing --cov-fail-under=95 | tee pytest-coverage.txt | |
echo "STATUS=$(cat pytest-coverage.txt | grep 'Required test' | awk '{ print $1 }')" >> $GITHUB_ENV | |
echo "${{ env.STATUS }}" | |
echo "FAILED=$(cat test-reports/report.xml | awk -F'=' '{print $5}' | awk -F' ' '{gsub(/"/, "", $1); print $1}')" >> $GITHUB_ENV | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
if: ${{ always() && github.ref != 'refs/heads/master' }} | |
with: | |
create-new-comment: true | |
pytest-coverage-path: ./pytest-coverage.txt | |
junitxml-path: ./test-reports/report.xml | |
- name: Evaluate Coverage | |
if: ${{ (env.STATUS == 'FAIL') || (env.FAILED > 0) }} | |
run: exit 1 |