Skip to content

Commit 798b4ef

Browse files
ci: Add test action
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent f5a4c71 commit 798b4ef

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
name: Generate and test (Python ${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install jinja2
34+
35+
- name: Generate message definitions
36+
run: generate/generate-python.py --output-dir=brping
37+
38+
- name: Verify core generated files exist
39+
run: |
40+
for f in definitions.py device.py ping1d.py ping360.py; do
41+
test -s "brping/$f" || { echo "Missing or empty generated file: brping/$f"; exit 1; }
42+
done
43+
44+
- name: Install package
45+
run: pip install .
46+
47+
- name: Check generated code compiles
48+
run: python -m compileall -q brping
49+
50+
- name: Check package imports
51+
run: python -c "import brping; print('brping imported successfully')"
52+
53+
- name: Test message API
54+
run: python brping/pingmessage.py

0 commit comments

Comments
 (0)