Repository navigation
195 lines (176 loc) · 6.55 KB
/
Copy pathci.yml
File metadata and controls
195 lines (176 loc) · 6.55 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
release-contract:
name: Release contract
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Test release index generation
run: python3 scripts/ONNX/test_create_release_index.py
onnx-dependencies:
name: Locked ONNX dependencies
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install dependency build tools
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential git ca-certificates curl python3-pip ninja-build pkg-config cmake
python3 -m pip install --break-system-packages 'cmake>=3.28'
- name: Build or restore locked ONNX dependency cache
uses: ./.github/actions/setup-onnx-dependencies
with:
profile: cpu
prefix: ${{ github.workspace }}/.deps/onnx/cpu
work-dir: ${{ runner.temp }}/onnx-build/cpu
test:
name: Test & Coverage
needs: onnx-dependencies
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
git \
ca-certificates \
curl \
python3-pip \
ninja-build \
pkg-config \
cmake \
libmbedtls-dev \
libxml2-dev \
gcovr \
libavcodec-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libswresample-dev \
ffmpeg \
libsrtp2-dev \
libusrsctp-dev \
libssl-dev \
libsrt-openssl-dev \
libjpeg-dev \
libpng-dev \
zlib1g-dev
python3 -m pip install --break-system-packages 'meson>=1.6.0'
- name: Restore and verify locked ONNX dependencies
uses: ./.github/actions/setup-onnx-dependencies
with:
profile: cpu
prefix: ${{ github.workspace }}/.deps/onnx/cpu
work-dir: ${{ runner.temp }}/onnx-build/cpu
- name: Build with coverage
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/.deps/onnx/cpu/lib/pkgconfig
CMAKE_PREFIX_PATH: ${{ github.workspace }}/.deps/onnx/cpu
run: |
meson setup build \
-Db_coverage=true \
-DWITH_AV=true \
-DONNX=enabled \
-DONNX_STATIC=true \
-DONNX_PROFILE=cpu \
-DDEBUG=4
# Assert NDI/ONVIF support was actually compiled in (libs are present in this env).
grep -qE 'NDI:[[:space:]]+COMPILED' build/meson-logs/meson-log.txt || { echo "::error::NDI support was not compiled"; exit 1; }
grep -qE 'ONVIF camera discovery:[[:space:]]+YES' build/meson-logs/meson-log.txt || { echo "::error::ONVIF support was not built"; exit 1; }
grep -qE 'ONNX AI processing:[[:space:]]+YES \(profile=cpu\)' build/meson-logs/meson-log.txt || { echo "::error::ONNX CPU support was not built"; exit 1; }
ninja -C build
test -x build/MistProcONNX
- name: Provision pinned ONNX integration model
run: |
scripts/ONNX/prepare_models.sh --dir "$RUNNER_TEMP/onnx-models" yolo26n
echo "MIST_ONNX_TEST_MODEL=$RUNNER_TEMP/onnx-models/yolo26n.onnx" >> "$GITHUB_ENV"
- name: Run tests
run: MIST_RUN_MEDIA_TESTS=1 meson test -C build --print-errorlogs --verbose
- name: Generate coverage
run: ninja -C build coverage
continue-on-error: true
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/meson-logs/coverage.xml
flags: cpp
fail_ci_if_error: false
asan:
name: AddressSanitizer
needs: onnx-dependencies
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
git \
ca-certificates \
curl \
python3-pip \
ninja-build \
pkg-config \
cmake \
libmbedtls-dev \
libxml2-dev \
clang \
libavcodec-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libswresample-dev \
libsrtp2-dev \
libusrsctp-dev \
libssl-dev \
libsrt-openssl-dev \
libjpeg-dev \
libpng-dev \
zlib1g-dev
python3 -m pip install --break-system-packages 'meson>=1.6.0'
- name: Restore and verify locked ONNX dependencies
uses: ./.github/actions/setup-onnx-dependencies
with:
profile: cpu
prefix: ${{ github.workspace }}/.deps/onnx/cpu
work-dir: ${{ runner.temp }}/onnx-build/cpu
- name: Build with ASan
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/.deps/onnx/cpu/lib/pkgconfig
CMAKE_PREFIX_PATH: ${{ github.workspace }}/.deps/onnx/cpu
run: |
CC=clang CXX=clang++ meson setup build-asan \
-Db_sanitize=address \
-Db_lundef=false \
-DWITH_AV=true \
-DONNX=enabled \
-DONNX_STATIC=true \
-DONNX_PROFILE=cpu
grep -qE 'NDI:[[:space:]]+COMPILED' build-asan/meson-logs/meson-log.txt || { echo "::error::NDI support was not compiled"; exit 1; }
grep -qE 'ONVIF camera discovery:[[:space:]]+YES' build-asan/meson-logs/meson-log.txt || { echo "::error::ONVIF support was not built"; exit 1; }
grep -qE 'ONNX AI processing:[[:space:]]+YES \(profile=cpu\)' build-asan/meson-logs/meson-log.txt || { echo "::error::ONNX CPU support was not built"; exit 1; }
ninja -C build-asan
test -x build-asan/MistProcONNX
- name: Run tests with ASan
run: |
export ASAN_OPTIONS=detect_leaks=1:halt_on_error=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
meson test -C build-asan --print-errorlogs --timeout-multiplier 3
- name: Upload ASan logs
if: always()
uses: actions/upload-artifact@v7
with:
name: asan-logs
path: build-asan/meson-logs/testlog.txt
if-no-files-found: ignore