forked from Sensing-Dev/sensing-dev-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
290 lines (235 loc) · 10.5 KB
/
develop-Linux.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
name: Generate Linux Config and test installation with script
# This workflow generate and copy
# 1. config_Windows.json based on the current latest config & release tag
# 2. setup.sh
# to artifact
#
# Then test installation with combination of
# [latest release, config_Linux.json]
# [ubuntu-22.04]
# [with/without OpenCV]
#
# For Aravis, we did not add the Python test yet
# TODO: after separate C++ and Python installation of Aravis, setup test
on:
pull_request:
branches:
- main
### modify here for update #####################################################
env:
TEST_CONFIG_VERSION_SDK: v99.99.99
REPO_NAME: Sensing-Dev/sensing-dev-installer
################################################################################
jobs:
set_env:
runs-on: ubuntu-22.04
outputs:
LATEST_RELEASED_SDK: ${{ steps.get_latest_tag.outputs.LATEST_RELEASED_SDK }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest release tag
id: get_latest_tag
run: |
latest_tag=$(curl -s https://api.github.com/repos/${{ env.REPO_NAME}}/releases/latest | jq -r .tag_name)
echo "LATEST_RELEASED_SDK=${latest_tag}" >> $GITHUB_OUTPUT
generate_config:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Create config for Linux
run: |
cd installer
mkdir build && cd build
python -m pip install --upgrade pip
pip install -r ${{ github.workspace }}/installer/src/requirements.txt
python ${{ github.workspace }}/installer/src/generate_config.py -p Linux -v ${{ env.TEST_CONFIG_VERSION_SDK}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: install-test-for-linux
path: |
${{ github.workspace }}/build/config_Linux.json
${{ github.workspace }}/installer/tools/setup.sh
${{ github.workspace }}/installer/testcases
test_installation:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [ubuntu-22.04]
install_option : ["--version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}", "--config-path config_Linux.json"]
with_openCV : ["", "--install-opencv"]
with_gst_option: ["", "--install-gst-tools", "--install-gst-tools --install-gst-plugin"]
exclude:
# InstallGstTools is not on the release version yet
- install_option: "--version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}"
with_gst_option: "--install-gst-tools"
- install_option: "--version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}"
with_gst_option: "--install-gst-tools --install-gst-plugin"
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: install-test-for-linux
path: download
- name: Set all items under test directory
run: |
mkdir -p ${{ github.workspace }}/test
mv ${{ github.workspace }}/download/build/config_Linux.json ${{ github.workspace }}/test
mv ${{ github.workspace }}/download/installer/tools/setup.sh ${{ github.workspace }}/test
- name: Install with the script from Artifacts (general)
run: |
cd ${{ github.workspace }}/test
chmod +x setup.sh
sudo bash setup.sh ${{ matrix.install_option }} ${{ matrix.with_openCV }} ${{ matrix.with_gst_option }} --verbose
- name: Check if version_info.json exists (v24.05 or later)
id: check_version_info
uses: andstor/file-existence-action@v3
with:
files: "/opt/sensing-dev/version_info.json"
fail: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Test Aravis installation and Path (v24.01 or later)
run: |
export LD_LIBRARY_PATH=/opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
cd ${{ github.workspace }}/download/installer/testcases/cpp/aravis_test
python_output=$(python ${{ github.workspace }}/download/installer/testcases/cpp/get_compile_command.py aravis_test.cpp)
echo "Python script output: $python_output"
eval "$python_output"
./aravis_test
- name: Test ion-kit (v24.01 or later)
run: |
export LD_LIBRARY_PATH=/opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
cd ${{ github.workspace }}/download/installer/testcases/cpp/ionkit_test
python_output=$(python ${{ github.workspace }}/download/installer/testcases/cpp/get_compile_command.py ionkit_test.cpp)
echo "Python script output: $python_output"
eval "$python_output"
./ionkit_test
- name: Test opencv (v24.01 or later)
if: ${{ (matrix.with_openCV == '--install-opencv') }}
run: |
export LD_LIBRARY_PATH=/opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
cd ${{ github.workspace }}/download/installer/testcases/cpp/opencv_test
python_output=$(python ${{ github.workspace }}/download/installer/testcases/cpp/get_compile_command.py opencv_test.cpp)
echo "Python script output: $python_output"
eval "$python_output"
./opencv_test
- name: Test gst-inspect-1.0 (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools' || matrix.with_gst_option == '--install-gst-tools --install-gst-plugin'}}
run: |
gst-inspect-1.0
echo "==="
gst-inspect-1.0 queue
- name: Test gst-plugin-base (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools --install-gst-plugin' }}
run: |
gst-inspect-1.0 videoconvert
- name: Test gst-plugin-good (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools --install-gst-plugin' }}
run: |
gst-inspect-1.0 multifilesrc
- name: Test gst-inspect-1.0 aravissrc (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools --install-gst-plugin' }}
run: |
export GST_PLUGIN_PATH=/opt/sensing-dev/lib/x86_64-linux-gnu/gstreamer-1.0/:$GST_PLUGIN_PATH
export LD_LIBRARY_PATH=/opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
gst-inspect-1.0 aravissrc
- name: Test gst-inspect-1.0 gendcseparator (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools --install-gst-plugin' }}
run: |
export GST_PLUGIN_PATH=/opt/sensing-dev/lib/x86_64-linux-gnu/gstreamer-1.0/:$GST_PLUGIN_PATH
gst-inspect-1.0 gendcseparator
test_python:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [ubuntu-22.04]
python_version: ["3.10", "3.11"]
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: install-test-for-linux
path: download
- name: Get config content and install python modules
run: |
apt-get -y upgrade && apt-get update && apt-get install -y jq
config_file="${{ github.workspace }}/download/build/config_Linux.json"
ionkit_version=$(jq -r '.ion_kit.version' $config_file)
gendc_separator_version=$(jq -r '.gendc_separator.version' $config_file)
if [[ $ionkit_version == v* ]]; then
ionkit_version=${ionkit_version:1}
fi
if [[ $gendc_separator_version == v* ]]; then
gendc_separator_version=${gendc_separator_version:1}
fi
pip install ion-contrib-python==$ionkit_version
pip install gendc-python==$gendc_separator_version
pip install numpy
pip install opencv-python
sudo apt install -y libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0
pip install aravis-python
pip3 install pycairo
pip3 install PyGObject
- name: Test Aravis
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python aravis_test.py
- name: Test ion-kit
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python ionkit_test.py
- name: Test ion-kit with Aravis
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
export GENICAM_FILENAME=${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml
python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py
- name: Test OpenCV
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python opencv_test.py
test_gst_opencv:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [ubuntu-22.04]
python_version: ["3.10", "3.11"]
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: install-test-for-linux
path: download
- name: Install Numpy
run: |
pip3 install numpy
- name: Install gstreamer
run: |
sudo apt-get update
sudo apt-get install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y
- name: Install OpenCV
run: |
pip3 install --no-binary opencv-python opencv-python==4.10.0.84 --verbose
- name: Test if opencv-python is built with gstreamer
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python opencv_gst_test.py