forked from mxcube/mxcubecore
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.69 KB
/
coverage_report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Coverage Report
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- '**.py'
jobs:
pytest-coverage:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev
python -m pip install --upgrade pip
python -m pip install poetry --user
python -m poetry install
- name: Run and write pytest
run: |
set -o pipefail
poetry run pytest --cov=mxcubecore --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverage-comment
uses: MishaKav/[email protected]
with:
repo-token: ${{ secrets.CI_TOKEN }}
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
report-only-changed-files: true
- name: Check the output coverage
run: |
echo "Coverage Percantage - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Warnings - ${{ steps.coverage-comment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverage-comment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverage-comment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverage-comment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverage-comment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverage-comment.outputs.time }}"