-
Notifications
You must be signed in to change notification settings - Fork 2
210 lines (181 loc) · 8.38 KB
/
cpp-python-tests.yml
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# Testing cpp and python libraries.
name: cpp-python-tests
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
pytest_stdout:
description: "Show test STDOUT in log for Pytest tests"
required: false
type: boolean
default: false
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13]
# os: [ubuntu-20.04, ubuntu-22.04, macos-13]
python-version: ["3.10"]
# python-version: ["3.8", "3.9", "3.10"]
build-type: [Debug]
# build-type: [Debug, Release]
enable-gstreamer: [ON, OFF]
enable-system-opencv: [OFF]
exclude:
- os: macos-13
enable-gstreamer: ON
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Add .local/bin to PATH (macOS, automatic on Linux)
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
if: runner.os == 'macOS'
- name: Use gcc-8 and g++-8 (ubuntu-18.04)
run: |
sudo apt-get install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100
sudo update-alternatives --set gcc /usr/bin/gcc-8
sudo update-alternatives --set g++ /usr/bin/g++-8
if: matrix.os == 'ubuntu-18.04'
- name: Generate Version Output
id: generate_version_output
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Print Version Information
run: echo "Version ${{ steps.generate_version_output.outputs.version }}"
- name: Generate OS Release Output
id: generate_os_release_name_output
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "os_release_name=${{runner.os}}-$(lsb_release -i -s)" >> $GITHUB_OUTPUT
else
echo "os_release_name=${{runner.os}}" >> $GITHUB_OUTPUT
fi
- name: Generate OS Release Version Output
id: generate_os_release_version_output
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "os_release_version=$(lsb_release -r -s)" >> $GITHUB_OUTPUT
elif [[ "${{ runner.os }}" == "macOS" ]]; then
echo "os_release_version=$(cmake -P cmake/macos_get_version_script.cmake)" >> $GITHUB_OUTPUT
fi
- name: Generate OS Release Architecture Output
id: generate_os_release_architecture_output
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "os_release_architecture=$(uname -i)" >> $GITHUB_OUTPUT
elif [[ "${{ runner.os }}" == "macOS" ]]; then
echo "os_release_architecture=$(uname -m)" >> $GITHUB_OUTPUT
fi
- name: Generate Release File Name
id: generate_release_file_name
run: |
echo "release_file_name=\
${{ steps.generate_os_release_name_output.outputs.os_release_name }}-\
${{ steps.generate_os_release_version_output.outputs.os_release_version }}-\
${{ steps.generate_os_release_architecture_output.outputs.os_release_architecture }}-\
${{ steps.generate_version_output.outputs.version }}" >> $GITHUB_OUTPUT
- name: Print Release File Name
run: echo "Release File Name ${{ steps.generate_release_file_name.outputs.release_file_name }}"
- name: Install system dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake build-essential libssl-dev libboost-all-dev
sudo apt-get install libglib2.0-dev libgtk-3-dev libpulse-dev libasound2-dev tree perl
sudo apt install libunwind-dev
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev
sudo apt-get install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools
sudo apt-get install gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5
sudo apt-get install gstreamer1.0-pulseaudio
if: runner.os == 'Linux'
- name: Install system dependencies (macOS)
run: |
brew update
brew install ninja tree ca-certificates perl
if: runner.os == 'macOS'
- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade twine
python -m pip install --user --upgrade pytest
python -m pip install --user --upgrade sphinx
python -m pip install --user --upgrade pybind11-stubgen
python -m pip install --user --upgrade numpy
python -m pip install --user -r signaling-server/requirements.txt
- name: Create build directory
run: |
mkdir build
- name: Run CMake and build opentera-webrtc
working-directory: build
run: |
cmake ../ -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX=dist \
-DOPENTERA_WEBRTC_NATIVE_CLIENT_PYTHON_PIP_INSTALL_PREFIX='--user' \
-DOPENTERA_WEBRTC_NATIVE_CLIENT_PYTHON_VERSION="$(python --version | perl -pe 's/Python //')" \
-DPython_ROOT_DIR="${{ env.pythonLocation }}" \
-DOPENTERA_WEBRTC_ENABLE_GSTREAMER=${{ matrix.enable-gstreamer }} \
-DOPENTERA_WEBRTC_USE_SYSTEM_OPENCV=${{ matrix.enable-system-opencv }}
file opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libboringssl.a
file opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libyuv_internal.a
for file in opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/boringssl/*; do
file "$file"
done
for file in opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libyuv_internal/*; do
file "$file"
done
VERBOSE=1 make
make install
- name: Python native_client build cleanup
working-directory: build/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/opentera_webrtc_native_client
run: |
rm -rfv build
rm -rfv '*.so'
rm -rfv opentera_webrtc_native_client.egg-info
rm -rfv _build
- name: Python signaling_server build cleanup
working-directory: build/signaling-server/opentera_webrtc_signaling_server
run: |
rm -rfv build
rm -rfv opentera_webrtc_signaling_server.egg-info
rm -rfv _build
- name: Run CPP Tests
working-directory: build/dist/bin
run: |
export LD_LIBRARY_PATH=$PWD
export GST_DEBUG=2
./OpenteraWebrtcNativeClientTests
# Without stdout
- name: Run Python signaling-server Tests
if: ${{ !github.event.inputs.pytest_stdout }}
working-directory: signaling-server
run: |
python -m pytest -v opentera_webrtc/tests
- name: Run Python webrtc-native-client Tests
if: ${{ !github.event.inputs.pytest_stdout }}
working-directory: opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/test
run: |
if [ -f requirements.txt ]; then python -m pip install --user -r requirements.txt; fi
python -m pytest -vv -s
# With stdout
- name: Run Python signaling-server Tests with STDOUT
if: ${{ github.event.inputs.pytest_stdout }}
working-directory: signaling-server
run: |
python -m pytest -v --capture=tee-sys opentera_webrtc/tests
- name: Run Python webrtc-native-client Tests with STDOUT
if: ${{ github.event.inputs.pytest_stdout }}
working-directory: opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/test
run: |
if [ -f requirements.txt ]; then python -m pip install --user -r requirements.txt; fi
python -m pytest -v --capture=tee-sys