-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.36 KB
/
python-tests.yml
File metadata and controls
46 lines (37 loc) · 1.36 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
name: Python Tests
on:
push:
branches: [ main, master ] # Run on pushes to main or master branches
pull_request:
branches: [ main, master ] # Optionally, run on pull requests
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write # <-- REQUIRED: Allows the action to commit the badge SVG
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # IMPORTANT: Ensures full history for committing changes
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies and coverage
run: |
python -m pip install --upgrade pip
pip install -e .
pip install coverage
- name: Run tests and collect coverage
run: |
coverage run --source="signifikante" -m unittest discover -s tests -v
NUMBA_DISABLE_JIT=1 coverage run -a --source="signifikante" -m unittest discover -s tests -p 'test_numba.py' -v
- name: Generate Coverage Badge
uses: tj-actions/coverage-badge-py@v2
- name: Commit and Push Badge
# Only commit the change if a badge file was created/updated
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'CI: update coverage badge'
files: coverage.svg