-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (96 loc) · 3.63 KB
/
Copy pathpython.yml
File metadata and controls
104 lines (96 loc) · 3.63 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# SPDX-FileCopyrightText: 2026 Afri Blank (@l5yth)
# SPDX-License-Identifier: Apache-2.0
name: python
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install dependencies
run: pip install rns cbor2 pytest coverage black
- name: Format check (ACCEPTANCE B5)
run: python -m black --check --diff .
- name: Tests (ACCEPTANCE B1)
run: python -m pytest -q
- name: Coverage floor 100% (ACCEPTANCE B2)
run: |
python -m coverage run -m pytest -q
python -m coverage report -m --fail-under=100
- name: API docs 100% (ACCEPTANCE B3)
run: python .github/scripts/check_docstrings.py
license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: SPDX tags and notices (ACCEPTANCE B4)
run: make license | tee /tmp/license.log
- name: Fail on any missing header
run: "! grep -q MISSING /tmp/license.log"
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install dependencies
run: pip install rns cbor2 tomlkit pytest
- name: Fetch the reference hub
run: git clone --depth 1 https://github.com/kc1awv/rrcd /tmp/rrcd
- name: Configure Reticulum for a single host
# The hub and the clients must share one Reticulum instance to reach
# each other. Reticulum's default config offers only AutoInterface,
# which needs link-local IPv6 multicast that CI containers do not
# have, so the processes come up isolated and every connect fails
# with "no path". Forcing the shared instance onto localhost TCP
# needs no interface at all: the first process to start becomes the
# instance and the others attach to it.
run: |
mkdir -p ~/.reticulum
cat > ~/.reticulum/config <<'CONFIG'
[reticulum]
# Transport must be on: it is what makes this node pass announces
# and serve path requests. With it off, only a client that happens
# to attach before the hub announces can ever find it, and the
# other waits out a full discovery timeout.
enable_transport = Yes
share_instance = Yes
shared_instance_type = tcp
shared_instance_port = 37500
instance_control_port = 37501
instance_name = e2eci
[logging]
loglevel = 4
[interfaces]
[[Default Interface]]
type = AutoInterface
enabled = No
CONFIG
sed -i 's/^ //' ~/.reticulum/config
cat ~/.reticulum/config
- name: Start a Reticulum shared instance
# Give the instance a deterministic owner. Without one, whichever
# process starts first becomes it, and a client that loses the race
# comes up isolated with no interfaces and never finds a path.
run: |
rnsd &
for _ in $(seq 1 20); do
rnstatus >/dev/null 2>&1 && break
sleep 1
done
rnstatus || echo "no shared instance; the hub will become one"
- name: End-to-end against a real rrcd hub (ACCEPTANCE A1)
env:
RRCD_PATH: /tmp/rrcd
run: make e2e PYTHON=python
- name: Hub log on failure
if: failure()
run: find /tmp -name 'rrcd.log' -exec tail -n 60 {} + || true