-
-
Notifications
You must be signed in to change notification settings - Fork 505
60 lines (50 loc) · 1.64 KB
/
Copy pathtest.yml
File metadata and controls
60 lines (50 loc) · 1.64 KB
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
name: Test
on:
push:
branches: [master]
paths:
- "src/**/*.py"
- "tests/**/*.py"
pull_request:
branches: [master]
# paths:
# - "src/**/*.py"
# - "tests/**/*.py"
jobs:
test-and-coverage:
name: "Test and Coverage"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }} with uv
uses: ./.github/actions/setup-python-with-uv
with:
python-version: ${{ matrix.python-version }}
- name: Creating .github-pytest and coverage folders
run: mkdir -p ./.github-pytest/coverage
- name: Run pytest
run: |
set -o pipefail
uv run pytest --cov-fail-under=70 --junitxml=./.github-pytest/pytest-output.xml | tee .github-pytest/pytest-coverage.txt
env:
OMR_CHECKER_CONTAINER: true
# Note: TZ override no longer needed as we're now setting it during test execution itself.
# TZ: Asia/Kolkata
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@v1
with:
pytest-coverage-path: ./.github-pytest/pytest-coverage.txt
junitxml-path: ./.github-pytest/pytest-output.xml
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@v2
with:
output: .github-pytest/coverage/coverage.svg
- name: Publish coverage report to coverage-badge branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: coverage-badge
folder: .github-pytest/coverage