-
Notifications
You must be signed in to change notification settings - Fork 12
80 lines (73 loc) · 2.27 KB
/
ci.yml
File metadata and controls
80 lines (73 loc) · 2.27 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test suite
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
permissions: write-all
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install necessary packages
run: |
sudo apt-get install -y linux-image-$(uname -r) linux-modules-extra-$(uname -r)
- name: Setup user groups
run: |
sudo python scripts/test_setup.py
ls -lsa /dev/video* /dev/uinput /dev/gpio* /dev/inp*
- name: Set up Python ${{ matrix.python-version }}
id: setuppy
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: 'pip'
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install --disable-pip-version-check -e . --group=dev_no_qt
- name: Linting
run: |
ruff check --diff --output-format=github linuxpy tests examples
ruff format linuxpy tests examples --check
- name: Build package
run: |
python -m build
twine check dist/*
- name: Tests
id: tests
run: |
pytest -k "not qt"
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: html_report-${{ matrix.python-version }}
path: ./htmlcov/
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
badge: true
format: 'markdown'
output: 'both'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
path: code-coverage-results.md
recreate: true
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY