-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.54 KB
/
test-coverage.yml
File metadata and controls
51 lines (43 loc) · 1.54 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
name: Test and Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install system build dependencies required to build native example libraries
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build pkg-config libdbus-1-dev libglib2.0-dev libudev-dev python3-dev
# Install dev, test and examples extras so CI has the BLE example libraries
pip install -e .[dev,test,examples]
- name: Run tests with coverage
run: |
python -m pytest tests/ --cov=src/bluetooth_sig --cov-report=html --cov-report=xml --cov-report=term-missing
- name: Extract coverage percentage and create badge
if: matrix.python-version == '3.12'
run: |
python scripts/extract_coverage_badge.py
- name: Deploy coverage to GitHub Pages
if: matrix.python-version == '3.12' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: htmlcov
destination_dir: coverage