Repository navigation
367 lines (304 loc) · 14.3 KB
/
Copy pathdevelop-Windows.yml
File metadata and controls
367 lines (304 loc) · 14.3 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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
name: Generate Windows Config and test installation with script
on:
pull_request:
branches:
- main
### modify here for update #####################################################
env:
TEST_CONFIG_VERSION_SDK: v99.99.99
LATEST_OPENCV_VERSION: 4.10.0
LATEST_OPENCV_BIN_PATH: opencv/build/x64/vc16/bin
REPO_NAME: Sensing-Dev/sensing-dev-installer
################################################################################
jobs:
set_env:
runs-on: windows-latest
outputs:
LATEST_RELEASED_SDK: ${{ steps.get_latest_tag.outputs.LATEST_RELEASED_SDK }}
steps:
- name: Get latest release tag
id: get_latest_tag
run: |
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ env.REPO_NAME}}/releases/latest"
$latestTag = $releases.tag_name
echo "LATEST_RELEASED_SDK=$latestTag" >> $env:GITHUB_OUTPUT
generate_config:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Create config for 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 -p Windows -v ${{ env.TEST_CONFIG_VERSION_SDK}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: install-test-for-windows
path: |
${{ github.workspace }}/build/config_Windows.json
${{ github.workspace }}/installer/tools/*
${{ github.workspace }}/installer/testcases
test_installation:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [windows-latest]
install_option : ["-version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}", "-configPath config_Windows.json"]
with_openCV : ["", "-InstallOpenCV"]
with_gst_option: ["", "-InstallGstTools", "-InstallGstTools -InstallGstPlugins"]
exclude:
# InstallGstTools is not on the release version yet
- install_option: "-version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}"
with_gst_option: "-InstallGstTools"
- install_option: "-version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}"
with_gst_option: "-InstallGstTools -InstallGstPlugins"
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: install-test-for-windows
path: download
- name: Set all items under test directory
run: |
New-Item -ItemType Directory -Path ${{ github.workspace }}/test | Out-Null
Move-Item -Path ${{ github.workspace }}/download/build/config_Windows.json -Destination ${{ github.workspace }}/test
Move-Item -Path ${{ github.workspace }}/download/installer/tools/installer.ps1 -Destination ${{ github.workspace }}/test
- name: Install with the script from Artifacts (v24.09 or later)
run: |
cd ${{ github.workspace }}/test
powershell.exe -ExecutionPolicy Bypass -File .\installer.ps1 ${{ matrix.install_option }} ${{ matrix.with_openCV }} ${{ matrix.with_gst_option }} -verbose
- name: Check if OpenCV exists on Windows (v24.09 or later)
if: ${{ (matrix.with_openCV == '-InstallOpenCV') }}
id: check_opencv
run: |
$filePath = "${env:LOCALAPPDATA}\sensing-dev\opencv"
if (Test-Path $filePath) {
Write-Output "File exists: $filePath"
} else {
Write-Output "File does not exist: $filePath"
exit 1
}
- name: Check if version_info.json exists (v24.05 or later)
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 (v24.09 or later)
if: ${{ matrix.with_openCV == '-InstallOpenCV' }}
run: |
$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 ./
cmake --build . --config Release
cd Release && ./opencv_test
- name: Test GenDC Header Library (v25.01 or later)
if: ${{ matrix.install_option == '--configPath config_Windows.json' }}
run: |
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd ${{ github.workspace }}/download/installer/testcases/cpp/gendc_test && cmake ./
cmake --build . --config Release
cd Release && ls && ./gendc_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
test_python:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [windows-latest]
python_version: ["3.10", "3.11"]
steps:
- name: Disable perl
run: |
rm -r C:\Strawberry\perl
- 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-windows
path: download
- name: Get config content and install python modules
run: |
$comp_info = Get-Content -Path ${{ github.workspace }}/download/build/config_Windows.json -Raw | ConvertFrom-Json
$ionkit_version = $comp_info.ion_kit.version
$gendc_separator_version = $comp_info.gendc_separator.version
if ( $ionkit_version.StartsWith("v") ){
$ionkit_version = $ionkit_version.substring(1)
}
if ( $gendc_separator_version.StartsWith("v") ){
$gendc_separator_version = $gendc_separator_version.substring(1)
}
pip install ion-contrib-python==$ionkit_version
pip install gendc-python==$gendc_separator_version
pip install numpy
pip install opencv-python
pip install aravis-python
- 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
$ENV: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
- name: Install pygobject
run: |
cd ${{ github.workspace }}/download/installer/tools
dir
.\pygobject_installer
- name: Test Aravis
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python aravis_test.py
- name: Test GenDC
run: |
cd ${{ github.workspace }}/download/installer/testcases/python
python gendc_test.py
test_gst_opencv:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
install_option : ["-version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}", "-configPath config_Windows.json"]
os: [windows-latest]
python_version: ["3.10", "3.11"]
overwrite_opencv: [true, false]
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-windows
path: download
- name: Set all items under test directory
run: |
New-Item -ItemType Directory -Path ${{ github.workspace }}/test | Out-Null
Move-Item -Path ${{ github.workspace }}/download/build/config_Windows.json -Destination ${{ github.workspace }}/test
Move-Item -Path ${{ github.workspace }}/download/installer/tools/installer.ps1 -Destination ${{ github.workspace }}/test
- name: Install Sensing-Dev with the script from Artifacts (general)
run: |
cd ${{ github.workspace }}/test
powershell.exe -ExecutionPolicy Bypass -File .\installer.ps1 ${{ matrix.install_option }} -verbose
- name: Install Numpy
run: |
pip install numpy==2.1.1
- name: Install OpenCV (for overwrite test)
if: ${{ matrix.overwrite_opencv }}
continue-on-error: true
run: |
pip install opencv-python
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$GST_SENSING_DEV = Join-Path -Path $SENSING_DEV_ROOT -ChildPath "bin"
cd ${{ github.workspace }}/download/installer/testcases/python
python opencv_gst_test.py $GST_SENSING_DEV
if ($LASTEXITCODE -ne 0) {
Write-Output "This opencv-python is not built with Gstreamer"
} else {
Write-Output "This opencv-python is built with Gstreamer"
}
- name: Run opencv-python with gstreamer installer script
run: |
cd ${{ github.workspace }}/download/installer/tools/
powershell.exe -ExecutionPolicy Bypass -File .\opencv_python_installer.ps1
if ($LASTEXITCODE -ne 0) {
Write-Error "The opencv_python_installer.ps1 script failed."
exit 1
}
- name: Test opencv-python with gstreamer
run: |
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$GST_SENSING_DEV = Join-Path -Path $SENSING_DEV_ROOT -ChildPath "bin"
cd ${{ github.workspace }}/download/installer/testcases/python
python opencv_gst_test.py $GST_SENSING_DEV
if ($LASTEXITCODE -eq 0) {
Write-Output "PASSED This opencv-python is built with Gstreamer"
} else {
Write-Output "FAILED: This opencv-python is not built with Gstreamer"
exit 1
}