-
Notifications
You must be signed in to change notification settings - Fork 54
68 lines (63 loc) · 2.62 KB
/
python-coverage.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Python coverage
on: ["push"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python3-tk python3-dev
sudo apt-get install xvfb
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
touch /home/runner/.Xauthority
- name: Build unit coverage using pytest-cov
run: |
pytest --cov=pyflow --cov-report=xml tests/unit
score=$(python coverage_score.py --score)
color=$(python coverage_score.py --color)
echo "COVERAGE_UNIT_SCORE=$score"
echo "COVERAGE_UNIT_COLOR=$color"
echo "COVERAGE_UNIT_SCORE=$score" >> $GITHUB_ENV
echo "COVERAGE_UNIT_COLOR=$color" >> $GITHUB_ENV
- name: Create unit coverage badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 00ce73155619a4544884ca6d251954b3
filename: pyflow_unit_coverage_badge.json
label: Unit coverage
message: ${{ env.COVERAGE_UNIT_SCORE }}
color: ${{ env.COVERAGE_UNIT_COLOR }}
style: plastic
- name: Build integration coverage using pytest-cov
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1080x24 -ac +extension GLX
pytest -s --cov=pyflow --cov-report=xml tests/integration
score=$(python coverage_score.py --score)
color=$(python coverage_score.py --color)
echo "COVERAGE_INTEGRATION_SCORE=$score"
echo "COVERAGE_INTEGRATION_COLOR=$color"
echo "COVERAGE_INTEGRATION_SCORE=$score" >> $GITHUB_ENV
echo "COVERAGE_INTEGRATION_COLOR=$color" >> $GITHUB_ENV
env:
DISPLAY: :99
# QT_DEBUG_PLUGINS: 1 # Uncomment to debug Qt library issues.
- name: Create integration coverage badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 00ce73155619a4544884ca6d251954b3
filename: pyflow_integration_coverage_badge.json
label: Integration coverage
message: ${{ env.COVERAGE_INTEGRATION_SCORE }}
color: ${{ env.COVERAGE_INTEGRATION_COLOR }}
style: plastic