forked from lorabasics/basicstation
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (84 loc) · 3.29 KB
/
regr-tests.yml
File metadata and controls
86 lines (84 loc) · 3.29 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
name: regr-tests
on: [push]
jobs:
run-regr-tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mbedtls-version: ['2.28.8', '3.6.0']
test-category: ['core', 'tls-cups', 'updn', 'pps']
variant: ['testsim', 'testms']
name: ${{ matrix.test-category }}/${{ matrix.variant }} (mbedtls ${{ matrix.mbedtls-version }})
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup environment
run: |
# python3-jsonschema and python3-jinja2 required for mbedtls 3.x build scripts
sudo apt-get install -y python3.11 python3-pip virtualenv psmisc git build-essential lcov curl netcat-openbsd python3-jsonschema python3-jinja2
virtualenv --python python3.11 --system-site-packages pyenv
. pyenv/bin/activate
pip3 install setuptools aiohttp websockets
- name: Execute Tests
env:
MBEDTLS_VERSION: ${{ matrix.mbedtls-version }}
run: |
# relax some regr test success conditions - related to timing
. pyenv/bin/activate
export PPSTHRES=100
export TX_AIM_GAP='"40ms"'
cd regr-tests && ./run-tests-${{ matrix.test-category }} --nohw --verbose --ghactions -V${{ matrix.variant }}
- name: Archive logs
uses: actions/upload-artifact@v4
if: always()
with:
name: logs-${{ matrix.test-category }}-${{ matrix.variant }}-mbedtls-${{ matrix.mbedtls-version }}
path: regr-tests/t.log/**/*.log
- name: Collect coverage files
if: always()
run: |
mkdir -p regr-tests/coverage
find regr-tests -name '${{ matrix.variant }}*.info' -exec cp {} regr-tests/coverage/ \; 2>/dev/null || true
- name: Upload coverage info
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.test-category }}-${{ matrix.variant }}-mbedtls-${{ matrix.mbedtls-version }}
path: regr-tests/coverage/
# Combine coverage reports from all test jobs
coverage-report:
runs-on: ubuntu-22.04
needs: run-regr-tests
if: always()
name: Coverage Report
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup lcov
run: sudo apt-get install -y lcov
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage/
merge-multiple: true
- name: Merge coverage reports
run: |
# Find all .info files
info_files=$(find coverage -name '*.info' -type f 2>/dev/null)
if [ -n "$info_files" ]; then
lcov -t "s2core" $(for f in $info_files; do echo "-a $f"; done) -o s2core.info
# Remove any entries for non-existent source files (e.g., srctype)
lcov --remove s2core.info '*/srctype' -o s2core.info || true
genhtml s2core.info -o s2core-html --ignore-errors source
else
echo "No coverage files found"
mkdir -p s2core-html
echo "No coverage data" > s2core-html/index.html
fi
- name: Upload combined coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: s2core-html/