Repository navigation
48 lines (44 loc) · 1.5 KB
/
Copy pathtests.yml
File metadata and controls
48 lines (44 loc) · 1.5 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
name: tests
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
unit:
name: unit tests (Python ${{ matrix.python }})
# 22.04: the last runner image with prebuilt Python 3.8
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: lint
if: matrix.python == '3.13'
run: |
python -m pip install --quiet pyflakes
python -m pyflakes webtop.py tests/*.py tools/*.py docs/demo/*.py
bash -n tests/lab/*.sh
- name: dashboard embedded in webtop.py matches web/index.html
run: python tools/embed_web.py --check
- name: unit tests
run: python -m unittest -v tests/test_unit.py
live:
name: live tests as root (netlink exec monitor, safe simulator)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: unit tests as root (incl. netlink proc connector)
run: sudo python3 -m unittest -v tests/test_unit.py
- name: end-to-end against the safe simulator (18 detections, 2 rounds)
run: sudo python3 tests/check_sim.py 2
- name: JSON snapshot of the runner
run: |
sudo ./webtop.py --once --duration 3 > /tmp/snap.json
python3 -c "import json; d=json.load(open('/tmp/snap.json')); print(sorted(d))"