11name : pytest
22
3- on : [push, pull_request]
3+ on : [ push, pull_request ]
44
55jobs :
66 pytest :
@@ -11,12 +11,64 @@ jobs:
1111 - name : Checkout repo
1212 uses : actions/checkout@v4
1313
14+ - name : Setup Python
15+ uses : actions/setup-python@v5
16+ with :
17+ python-version : ' 3.12'
18+ cache : ' pip'
19+
20+ - name : Install system dependencies
21+ run : |
22+ # dont run update, it is slow
23+ # sudo apt-get update
24+ sudo apt-get install -y --no-install-recommends \
25+ libxkbcommon-x11-0 \
26+ x11-utils \
27+ libyaml-dev \
28+ libegl1-mesa \
29+ libxcb-icccm4 \
30+ libxcb-image0 \
31+ libxcb-keysyms1 \
32+ libxcb-randr0 \
33+ libxcb-render-util0 \
34+ libxcb-xinerama0 \
35+ libopengl0 \
36+ libxcb-cursor0 \
37+ libpulse0
38+
1439 - name : Install dependencies
1540 run : |
16- python -m pip install --upgrade pip
17- pip install -r requirements.txt
18- pip install -r requirements-dev.txt
41+ python -m pip install --upgrade uv
42+ uv pip install --system -r requirements.txt
43+ uv pip install --system -r requirements-dev.txt
1944
20- - name : Run tests
45+ - name : Run pytest
2146 run : |
22- pytest tagstudio/tests/
47+ xvfb-run pytest --cov-report xml --cov=tagstudio
48+
49+ - name : Store coverage
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : ' coverage'
53+ path : ' coverage.xml'
54+
55+ coverage :
56+ name : Check Code Coverage
57+ runs-on : ubuntu-latest
58+ needs : pytest
59+
60+ steps :
61+ - name : Load coverage
62+ uses : actions/download-artifact@v4
63+ with :
64+ name : ' coverage'
65+
66+ - name : Check Code Coverage
67+ uses : yedpodtrzitko/coverage@main
68+ with :
69+ thresholdAll : 0.5
70+ thresholdNew : 0.5
71+ thresholdModified : 0.5
72+ coverageFile : coverage.xml
73+ token : ${{ secrets.GITHUB_TOKEN }}
74+ sourceDir : tagstudio/src
0 commit comments