forked from Sensing-Dev/sensing-dev-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
329 lines (289 loc) · 14.3 KB
/
Release.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
name: Generate Release version info
on:
push:
tags:
- "v*.*.*" # vYY.MM.Patch example v23.08.00 etc.
### modify here for update #####################################################
env:
SENSING_DEV_V24_01: v24.01.04
SENSING_DEV_V24_05: v24.05.10
SENSING_DEV_V24_09: v24.09.08
################################################################################
jobs:
set_env:
runs-on: ubuntu-22.04
outputs:
ref_name: ${{ steps.get_ref_name.outputs.ref_name }}
SENSING_DEV_V24_01: ${{ steps.set_vars.outputs.SENSING_DEV_V24_01 }}
SENSING_DEV_V24_05: ${{ steps.set_vars.outputs.SENSING_DEV_V24_05 }}
SENSING_DEV_V24_09: ${{ steps.set_vars.outputs.SENSING_DEV_V24_09 }}
steps:
- name: Get the ref name
id: get_ref_name
run: |
echo "ref_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Set environment variables
id: set_vars
run: |
echo "SENSING_DEV_V24_01=${{ env.SENSING_DEV_V24_01}}" >> $GITHUB_OUTPUT
echo "SENSING_DEV_V24_05=${{ env.SENSING_DEV_V24_05}}" >> $GITHUB_OUTPUT
echo "SENSING_DEV_V24_09=${{ env.SENSING_DEV_V24_09}}" >> $GITHUB_OUTPUT
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
ref: ${{ needs.set_env.outputs.ref_name }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Create config for Linux and Windows
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 -v ${{ github.ref_name }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: test-cases
path: |
${{ github.workspace }}/installer/testcases
${{ github.workspace }}/build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.workspace }}/build/*
${{ github.workspace }}/installer/tools/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
################################################################################
#
# Test to install Linux with released installer
#
################################################################################
linux_installation:
runs-on: ${{ matrix.os }}
needs: [set_env, release]
strategy:
matrix:
os: [ubuntu-22.04]
version : ["--version ${{ needs.set_env.outputs.ref_name }}", "--version ${{ needs.set_env.outputs.SENSING_DEV_V24_05 }}", ""]
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
- version: "--version ${{ needs.set_env.outputs.SENSING_DEV_V24_05 }}"
with_gst_option: "--install-gst-tools"
- version: "--version ${{ needs.set_env.outputs.SENSING_DEV_V24_05 }}"
with_gst_option: "--install-gst-tools --install-gst-plugin"
- version: ""
with_gst_option: "--install-gst-tools"
- version: ""
with_gst_option: "--install-gst-tools --install-gst-plugin"
steps:
- name: Download installer & install
run: |
mkdir setup_dir && cd setup_dir
wget -O setup.sh https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/setup.sh
chmod +x ${GITHUB_WORKSPACE}/setup_dir/setup.sh
sudo bash setup.sh ${{ matrix.version }} ${{ 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: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: test-cases
path: download
- 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
- name: Test gstreamer core with plugin (v24.12 or later)
if: ${{ matrix.with_gst_option == '--install-gst-tools --install-gst-plugin' }}
run: |
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 to install Windows with released installer
#
################################################################################
windows_installation:
runs-on: ${{ matrix.os }}
needs: [set_env, release]
strategy:
matrix:
os: [windows-2019, windows-latest]
version : ["-version ${{ needs.set_env.outputs.ref_name }}", ""]
with_openCV : ["", "-InstallOpenCV"]
with_gst_option : ["", "-InstallGstTools", "-InstallGstTools -InstallGstPlugins"]
include:
# past version only supports full-option with the latest installer.ps1
# -InstallOpenCV is valid on v24.09 or later on windows-2022
- os: windows-2019
with_openCV: "-InstallOpenCV"
with_gst_option : ""
version: "-version ${{ needs.set_env.outputs.SENSING_DEV_V24_05 }}"
- os: windows-2019
with_openCV: "-InstallOpenCV"
with_gst_option : ""
version: "-version ${{ needs.set_env.outputs.SENSING_DEV_V24_01 }}"
- os: windows-2022
with_openCV: "-InstallOpenCV"
with_gst_option : ""
version: "-version ${{ needs.set_env.outputs.SENSING_DEV_V24_09 }}"
- os: windows-2019
with_openCV: "-InstallOpenCV"
with_gst_option : ""
version: "-version ${{ needs.set_env.outputs.SENSING_DEV_V24_09 }}"
exclude:
# skip the following combination since the latest is v24.09 for now
- version: ""
with_gst_option: "-InstallGstTools"
- version: ""
with_gst_option: "-InstallGstTools -InstallGstPlugins"
steps:
- name: Download installer & install
run: |
$url = "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.ps1"
Invoke-WebRequest $url -OutFile .\installer.ps1
powershell.exe -ExecutionPolicy Bypass -File .\installer.ps1 ${{ matrix.version }} ${{ matrix.with_openCV }} ${{ matrix.with_gst_option }} -verbose
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: test-cases
path: download
- name: Check if version_info.json exists (v24.05 or later)
if: ${{ matrix.version != format('-version {0}', env.SENSING_DEV_V24_01) }}
run: |
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$target_file = Join-Path -Path "$SENSING_DEV_ROOT" -ChildPath "version_info.json"
if (Test-Path $target_file){
echo "version_info.json exists."
} else{
echo "version_info.json does not exist."
exit 1
}
- name: Test Aravis installation and Path (v24.01 or later)
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:PATH="$env:PATH;$PATH"
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd ${{ github.workspace }}/download/installer/testcases/cpp/aravis_test && cmake ./
cmake --build . --config Release
cd Release && ls && ./aravis_test
- name: Test ion-kit (v24.01 or later)
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:PATH="$env:PATH;$PATH"
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd ${{ github.workspace }}/download/installer/testcases/cpp/ionkit_test && cmake ./
cmake --build . --config Release
cd Release && ls && ./ionkit_test
- name: Test opencv (general)
if: ${{(matrix.with_openCV == '-InstallOpenCV')}}
run: |
$sensingdevShortVersion = '${{ matrix.version }}' -replace "-version ", ""
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
$env:PATH="$env:PATH;$PATH"
cd ${{ github.workspace }}/download/installer/testcases/cpp/opencv_test && cmake ./ -DSDK_VERSION="$sensingdevShortVersion"
cmake --build . --config Release
cd Release && ls && ./opencv_test
- name: Test gst-inspect-1.0 and gstreamer (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools' || matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins'}}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0
- name: Test gstreamer core with plugin (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins' }}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0 queue
- name: Test gst-plugin-base (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins' }}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0 videoconvert
- name: Test gst-plugin-good (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins' }}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0 multifilesrc
- name: Test gst-inspect-1.0 aravissrc (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools' || matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins'}}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0 aravissrc
- name: Test gst-inspect-1.0 gendcseparator (v24.12 or later)
if: ${{ matrix.with_gst_option == '-InstallGstTools' || matrix.with_gst_option == '-InstallGstTools -InstallGstPlugins'}}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$env:PATH="$env:PATH;$PATH"
$env:GST_PLUGIN_PATH=[Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
gst-inspect-1.0 gendcseparator