Repository navigation
184 lines (155 loc) · 7.82 KB
/
Copy pathbuild.yml
File metadata and controls
184 lines (155 loc) · 7.82 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
name: Build Test on GCC and MSVC
on:
pull_request:
branches:
- '*' # This will run the build and test jobs for pull requests to all branches
env:
SDK_VERSION: v25.01.00
ION_CONTRIB_PYTHON: 3.2.6
ARAVIS_PYTHON: 0.8.31.dev1
GENDC_PYTHON: 0.4.0
jobs:
test-cpp:
runs-on: ${{ matrix.os }}
env:
LD_LIBRARY_PATH: /opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu
strategy:
matrix:
os: [ubuntu-22.04, windows-2019, windows-2022]
tutorial_file_name: [tutorial0_get_device_info, tutorial0_set_device_info, tutorial1_display, tutorial2_control_camera, tutorial3_getting_frame_count, tutorial4_save_gendc_data, tutorial4_save_image_bin_data, tutorial5_parse_gendc_data, tutorial5_parse_image_bin_data]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install sensing-dev SDK on Ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
dl_version=$(echo ${{ env.SDK_VERSION }} | cut -d'-' -f1)
echo "$dl_version will be installed"
mkdir setup_dir && cd setup_dir
wget -O setup.sh https://github.com/Sensing-Dev/sensing-dev-installer/releases/download/${{ env.SDK_VERSION}}/setup.sh
chmod +x ${GITHUB_WORKSPACE}/setup_dir/setup.sh
sudo bash ${GITHUB_WORKSPACE}/setup_dir/setup.sh --install-opencv -v $dl_version
- name: Build ${{ matrix.tutorial_file_name}} with GCC
if: matrix.os == 'ubuntu-22.04'
run: |
cd ${GITHUB_WORKSPACE}/cpp
python_output=$(python ${GITHUB_WORKSPACE}/.github/get_compile_command.py src/${{ matrix.tutorial_file_name}}.cpp)
echo "Python script output: $python_output"
eval "$python_output"
- name: Memory leak check ${{ matrix.tutorial_file_name}} on Ubuntu 22.04 with dummy GenDC data
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.tutorial_file_name == 'tutorial5_parse_gendc_data') }}
run: |
sudo apt-get -y update && sudo apt-get install -y valgrind
cd ${GITHUB_WORKSPACE}/cpp
wget https://raw.githubusercontent.com/Sensing-Dev/GenDC/main/test/generated_stub/output.bin
valgrind --leak-check=full ./${{ matrix.tutorial_file_name}} --use-dummy-data --quiet
- name: Install sensing-dev SDK on Windows MSVC 2019 & 2022
if: ${{ (matrix.os == 'windows-2019') || (matrix.os == 'windows-2022') }}
run: |
mkdir setup_dir && cd setup_dir
Invoke-WebRequest -Uri https://github.com/Sensing-Dev/sensing-dev-installer/releases/download/${{ env.SDK_VERSION }}/installer.ps1 -OutFile installer.ps1 -Verbose
powershell.exe -ExecutionPolicy Bypass -File ./installer.ps1 -user $env:USERNAME -version ${{ env.SDK_VERSION }} -InstallOpenCV
echo 'SENSING_DEV_ROOT=$env:SENSING_DEV_ROOT' >> $GITHUB_ENV
- name: Build ${{ matrix.tutorial_file_name}} on Windows
if: ${{ (matrix.os == 'windows-2019') || (matrix.os == 'windows-2022') }}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
Write-Host PATH = $PATH
$env:PATH="$env:PATH;$PATH"
$GST_PLUGIN_PATH = [Environment]::GetEnvironmentVariable("GST_PLUGIN_PATH", "User")
Write-Host GST_PLUGIN_PATH = $GST_PLUGIN_PATH
$env:GST_PLUGIN_PATH=${GST_PLUGIN_PATH}
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
Write-Host SENSING_DEV_ROOT = $SENSING_DEV_ROOT
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd cpp
mkdir build && cd build
cmake --trace-expand ../ -DBUILD_TUTORIAL=${{ matrix.tutorial_file_name}}
cmake --build . --config Release
fake-test-cpp:
runs-on: ${{ matrix.os }}
env:
LD_LIBRARY_PATH: /opt/sensing-dev/lib:/opt/sensing-dev/lib/x86_64-linux-gnu
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
tutorial_file_name: [fake_camera_display, fake_camera_save]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install sensing-dev SDK on Ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
dl_version=$(echo ${{ env.SDK_VERSION }} | cut -d'-' -f1)
echo "$dl_version will be installed"
mkdir setup_dir && cd setup_dir
wget -O setup.sh https://github.com/Sensing-Dev/sensing-dev-installer/releases/download/${{ env.SDK_VERSION}}/setup.sh
chmod +x ${GITHUB_WORKSPACE}/setup_dir/setup.sh
sudo bash ${GITHUB_WORKSPACE}/setup_dir/setup.sh --install-opencv -v $dl_version
- name: Build and run ${{ matrix.tutorial_file_name}} with GCC
if: matrix.os == 'ubuntu-22.04'
run: |
cd ${GITHUB_WORKSPACE}/test/cpp
python_output=$(python ${GITHUB_WORKSPACE}/.github/get_compile_command.py src/${{ matrix.tutorial_file_name}}.cpp)
echo "Python script output: $python_output"
eval "$python_output"
./${{ matrix.tutorial_file_name}}
env:
GENICAM_FILENAME: ../arv-fake-camera.xml
- name: Memory leak check tutorial5_parse_image_bin_data on Ubuntu 22.04 with dummy image data saved by ${{ matrix.tutorial_file_name}}
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.tutorial_file_name == 'fake_camera_save') }}
run: |
sudo apt-get -y update && sudo apt-get install -y valgrind
cd ${GITHUB_WORKSPACE}/cpp
python_output=$(python ${GITHUB_WORKSPACE}/.github/get_compile_command.py src/tutorial5_parse_image_bin_data.cpp)
echo "Python script output: $python_output"
eval "$python_output"
cp ${GITHUB_WORKSPACE}/test/cpp/tutorial_save_image*/* ${GITHUB_WORKSPACE}/cpp
valgrind --leak-check=full ./tutorial5_parse_image_bin_data --directory . --quiet
- name: Install sensing-dev SDK on Windows MSVC
if: matrix.os == 'windows-2022'
run: |
mkdir setup_dir && cd setup_dir
Invoke-WebRequest -Uri https://github.com/Sensing-Dev/sensing-dev-installer/releases/download/${{ env.SDK_VERSION }}/installer.ps1 -OutFile installer.ps1 -Verbose
powershell.exe -ExecutionPolicy Bypass -File ./installer.ps1 -user $env:USERNAME -version ${{ env.SDK_VERSION }} -InstallOpenCV
echo 'SENSING_DEV_ROOT=$env:SENSING_DEV_ROOT' >> $GITHUB_ENV
- name: Build and run ${{ matrix.tutorial_file_name}} on Windows
if: matrix.os == 'windows-2022'
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
Write-Host PATH = $PATH
$env:PATH="$env:PATH;$PATH"
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
Write-Host SENSING_DEV_ROOT = $SENSING_DEV_ROOT
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd test/cpp
mkdir build && cd build
cmake ../ -DBUILD_TUTORIAL=${{ matrix.tutorial_file_name}}
cmake --build . --config Release
./Release/${{ matrix.tutorial_file_name}}
env:
GENICAM_FILENAME: ../../arv-fake-camera.xml
fake-test-python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
tutorial_file_name: [fake_camera_display, fake_camera_save]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install python modules
run: |
pip install ion-contrib-python==${{ env.ION_CONTRIB_PYTHON }}
- name: Run fake camera display
run: |
cd test
python python/${{ matrix.tutorial_file_name}}.py
env:
GENICAM_FILENAME: arv-fake-camera.xml