Skip to content

Commit aad9398

Browse files
authored
Merge branch 'meshtastic:master' into master
2 parents 13b7d16 + ae71047 commit aad9398

5 files changed

Lines changed: 167 additions & 77 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: CI
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
25
on:
36
push:
47
branches:
@@ -8,7 +11,29 @@ on:
811
- master
912

1013
jobs:
14+
validate:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version:
19+
- "3.12"
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
- name: Install Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install meshtastic from local
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip3 install poetry
32+
poetry install --all-extras --with dev,powermon
33+
poetry run meshtastic --version
34+
1135
build:
36+
needs: validate
1237
runs-on: ubuntu-latest
1338
strategy:
1439
matrix:
@@ -21,8 +46,10 @@ jobs:
2146
- "3.14"
2247
steps:
2348
- uses: actions/checkout@v4
24-
- name: Install Python 3
49+
- name: Install Python ${{ matrix.python-version }}
2550
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
2653
- name: Uninstall meshtastic
2754
run: |
2855
pip3 uninstall -y meshtastic
@@ -34,15 +61,8 @@ jobs:
3461
run: |
3562
poetry install --all-extras --with dev,powermon
3663
poetry run meshtastic --version
37-
- name: Run pylint
38-
run: poetry run pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
39-
- name: Check types with mypy
40-
run: poetry run mypy meshtastic/
41-
- name: Run tests with pytest
42-
run: poetry run pytest --cov=meshtastic
43-
- name: Generate coverage report
44-
run: |
45-
poetry run pytest --cov=meshtastic --cov-report=xml
64+
- name: Run lint, type check, and tests in parallel
65+
run: make -j3 --output-sync=target ci
4666
- name: Upload coverage to Codecov
4767
uses: codecov/codecov-action@v4
4868
with:
@@ -53,26 +73,9 @@ jobs:
5373
name: codecov-umbrella
5474
fail_ci_if_error: true
5575
verbose: true
56-
validate:
57-
runs-on: ubuntu-latest
58-
strategy:
59-
matrix:
60-
python-version:
61-
- "3.12"
62-
steps:
63-
- uses: actions/checkout@v4
64-
with:
65-
persist-credentials: false
66-
- name: Install Python 3
67-
uses: actions/setup-python@v5
68-
- name: Install meshtastic from local
69-
run: |
70-
python -m pip install --upgrade pip
71-
pip3 install poetry
72-
poetry install
73-
poetry run meshtastic --version
7476

7577
simradio_testing:
78+
needs: [validate, build]
7679
runs-on: ubuntu-latest
7780
strategy:
7881
fail-fast: false

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,19 @@ cov:
4242
examples: FORCE
4343
pytest -mexamples
4444

45+
# CI targets (run via poetry, executed in parallel by the CI workflow)
46+
.PHONY: ci-pylint ci-mypy ci-test ci
47+
48+
ci-pylint:
49+
poetry run pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$$"
50+
51+
ci-mypy:
52+
poetry run mypy meshtastic/
53+
54+
ci-test:
55+
poetry run pytest --cov=meshtastic --cov-report=xml
56+
57+
ci: ci-pylint ci-mypy ci-test
58+
4559
# Makefile hack to get the examples to always run
4660
FORCE: ;

meshtastic/tests/firmware_harness.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,5 +351,7 @@ def _build_mesh_packet(packet: dict, data: bytes) -> mesh_pb2.MeshPacket:
351351
mp.decoded.request_id = decoded["requestId"]
352352
if "wantResponse" in decoded:
353353
mp.decoded.want_response = decoded["wantResponse"]
354+
if "bitfield" in decoded:
355+
mp.decoded.bitfield = decoded["bitfield"]
354356

355357
return mp

0 commit comments

Comments
 (0)