Skip to content

Commit c13a695

Browse files
committed
fixup! Add custom action and unified Linux build
1 parent 12d5ab4 commit c13a695

File tree

4 files changed

+146
-88
lines changed

4 files changed

+146
-88
lines changed

.github/workflows/OCV-PR-Linux.yaml

+20-10
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
needs:
4747
- branch_eval
4848
strategy:
49-
# Debugging
49+
# NOTE: Debugging
5050
# fail-fast: true
5151
# max-parallel: 3
5252
fail-fast: false
@@ -64,11 +64,12 @@ jobs:
6464
jpegxl: true
6565
avif: true
6666
avx2: true
67-
- version: '24.04_asan'
68-
image: '24.04:20241031'
69-
asan: true
70-
jpegxl: true
71-
avif: true
67+
# TODO: enable later
68+
# - version: '24.04_asan'
69+
# image: '24.04:20241031'
70+
# asan: true
71+
# jpegxl: true
72+
# avif: true
7273
- version: '22.04'
7374
image: '22.04:20230602'
7475
avif: true
@@ -83,10 +84,12 @@ jobs:
8384
container:
8485
image: 'quay.io/opencv-ci/opencv-ubuntu-${{ matrix.image }}'
8586
volumes:
87+
# NOTE: RU config
8688
- /mnt/cache/git_cache:/opt/git_cache
8789
- /mnt/cache/ci_cache/opencv:/opt/.ccache
8890
- /mnt/cache/binaries_cache:/opt/binaries_cache
8991
- vol_dnn_models:/opt/dnn-models
92+
# NOTE: CN config
9093
# - /home/opencv-cn/git_cache:/opt/git_cache
9194
# - /home/opencv-cn/ci_cache/opencv:/opt/.ccache
9295
# - /home/opencv-cn/binaries_cache:/opt/binaries_cache
@@ -110,8 +113,11 @@ jobs:
110113
${{ matrix.limited_api && '-DPYTHON3_LIMITED_API=ON' }}
111114
${{ matrix.asan && '-DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_CXX_FLAGS="-fsanitize=address"' }}
112115
HOME: ${{ contains(matrix.image, '24.04') && '/home/ubuntu' || '/home/ci' }}
116+
MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}"
117+
# NOTE: CN config
113118
# OPENCV_FOR_THREADS_NUM: 8
114119
# CMAKE_BUILD_PARALLEL_LEVEL: 8
120+
# NOTE: RU config
115121
OPENCV_FOR_THREADS_NUM: 10
116122
CMAKE_BUILD_PARALLEL_LEVEL: 20
117123

@@ -167,12 +173,16 @@ jobs:
167173
OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata'
168174
OPENCV_TEST_REQUIRE_DATA: 1
169175
OPENCV_TEST_CHECK_OPTIONAL_DATA: 1
170-
PYTHONPATH: '${{ env.HOME }}/build/python_loader:$PYTHONPATH'
171-
ASAN_OPTIONS: 'detect_leaks=0'
176+
PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH'
177+
# TODO: enable later
178+
# ASAN_OPTIONS: 'detect_leaks=0'
172179
with:
173180
workdir: '${{ env.HOME }}'
174-
builddir: 'build'
175-
suite: "[ 'linux-${{ matrix.branch }}', ${{ (github.event.repository.name == 'opencv_contrib') && format('''linux-contrib-{0}''', matrix.branch) || '' }} ]"
181+
builddir: '${{ env.MAIN_BUILD_DIR }}'
182+
plan: "test-plan-${{ matrix.branch }}.json"
183+
# NOTE: Just keeping this complex construction here for possible future use:
184+
# ${{ (github.event.repository.name == 'opencv_contrib') && format('''linux-contrib-{0}''', matrix.branch) || '' }}
185+
suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && 'linux-contrib' || 'linux' }} ]"
176186
filter: "[ 'ubuntu-common', ${{ matrix.avx2 && '''ubuntu-avx2''' }} ]"
177187
enable_python: "true"
178188
enable_java: "true"

run-tests/action.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ inputs:
77
builddir:
88
description: "Build directory"
99
default: "build"
10+
plan:
11+
description: "Test plan (relative to 'scripts/' subfolder)"
1012
suite:
1113
description: "Suite in test plan (gtest) (JSON list)"
1214
filter:
@@ -37,7 +39,7 @@ runs:
3739
'--workdir=${{ inputs.workdir }}/${{ inputs.builddir }}' \
3840
'--bindir=bin' \
3941
'--logdir=.' \
40-
'--plan=scripts/test-plan.json' \
42+
'--plan=scripts/${{ inputs.plan }}' \
4143
--suite=${{ join(fromJSON(inputs.suite), ' --suite=') }} \
4244
--filter=${{ join(fromJSON(inputs.filter), ' --filter=') }} \
4345
'--options=${{ inputs.options }}' \

scripts/test-plan-4.x.json

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"suites": {
3+
"short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ],
4+
5+
"linux": [
6+
"opencv_test_calib3d",
7+
"opencv_test_core",
8+
"opencv_test_dnn",
9+
"opencv_test_features2d",
10+
"opencv_test_flann",
11+
"opencv_test_gapi",
12+
"opencv_test_highgui",
13+
"opencv_test_imgcodecs",
14+
"opencv_test_imgproc",
15+
"opencv_test_ml",
16+
"opencv_test_objdetect",
17+
"opencv_test_photo",
18+
"opencv_test_stitching",
19+
"opencv_test_video",
20+
"opencv_test_videoio",
21+
"opencv_perf_calib3d",
22+
"opencv_perf_core",
23+
"opencv_perf_dnn",
24+
"opencv_perf_features2d",
25+
"opencv_perf_gapi",
26+
"opencv_perf_imgcodecs",
27+
"opencv_perf_imgproc",
28+
"opencv_perf_objdetect",
29+
"opencv_perf_photo",
30+
"opencv_perf_stitching",
31+
"opencv_perf_video",
32+
"opencv_perf_videoio"
33+
],
34+
35+
"linux-contrib": [
36+
"opencv_test_bgsegm",
37+
"opencv_test_bioinspired",
38+
"opencv_test_dnn_superres",
39+
"opencv_test_face",
40+
"opencv_test_fuzzy",
41+
"opencv_test_hdf",
42+
"opencv_test_img_aug",
43+
"opencv_test_img_hash",
44+
"opencv_test_intensity_transform",
45+
"opencv_test_line_descriptor",
46+
"opencv_test_mcc",
47+
"opencv_test_optflow",
48+
"opencv_test_phase_unwrapping",
49+
"opencv_test_quality",
50+
"opencv_test_rapid",
51+
"opencv_test_reg",
52+
"opencv_test_rgbd",
53+
"opencv_test_saliency",
54+
"opencv_test_sfm",
55+
"opencv_test_shape",
56+
"opencv_test_stereo",
57+
"opencv_test_structured_light",
58+
"opencv_test_superres",
59+
"opencv_test_text",
60+
"opencv_test_tracking",
61+
"opencv_test_videostab",
62+
"opencv_test_wechat_qrcode",
63+
"opencv_test_xfeatures2d",
64+
"opencv_test_ximgproc",
65+
"opencv_test_xphoto",
66+
"opencv_perf_bioinspired",
67+
"opencv_perf_dnn_superres",
68+
"opencv_perf_features2d",
69+
"opencv_perf_line_descriptor",
70+
"opencv_perf_optflow",
71+
"opencv_perf_reg",
72+
"opencv_perf_rgbd",
73+
"opencv_perf_stereo",
74+
"opencv_perf_superres",
75+
"opencv_perf_tracking",
76+
"opencv_perf_xfeatures2d",
77+
"opencv_perf_ximgproc",
78+
"opencv_perf_xphoto"
79+
]
80+
},
81+
"filters": {
82+
"ubuntu-common": {
83+
"test_gapi": [
84+
"AsyncAPICancelation/cancel/*"
85+
],
86+
"test_videoio": [
87+
"videoio/videoio_synthetic.write_read_position/9",
88+
"videoio/videoio_synthetic.write_read_position/12",
89+
"videoio/videoio_synthetic.write_read_position/25",
90+
"videoio/videoio_synthetic.write_read_position/28",
91+
"videoio/videoio_synthetic.write_read_position/10",
92+
"videoio/videoio_synthetic.write_read_position/13",
93+
"videoio/videoio_synthetic.write_read_position/26",
94+
"videoio/videoio_synthetic.write_read_position/29",
95+
"videoio/videocapture_acceleration.read/24",
96+
"videoio/videocapture_acceleration.read/26",
97+
"videoio/videowriter_acceleration.write/40",
98+
"videoio/videowriter_acceleration.write/42"
99+
]
100+
},
101+
"ubuntu-avx2": {
102+
"test_core": [
103+
"Core_InRangeS/ElemWiseTest.accuracy/0",
104+
"Core_InRange/ElemWiseTest.accuracy/0"
105+
]
106+
}
107+
},
108+
"options": {
109+
"default": {
110+
"wrap": {
111+
"highgui": "xvfb-run -a"
112+
},
113+
"args": {
114+
"test": "--skip_unstable=1",
115+
"perf": "--perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1"
116+
},
117+
"exe": {},
118+
"env": {}
119+
}
120+
}
121+
}

scripts/test-plan.json scripts/test-plan-5.x.json

+2-77
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,8 @@
11
{
22
"suites": {
33
"short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ],
4-
"linux-4.x": [
5-
"opencv_test_calib3d",
6-
"opencv_test_core",
7-
"opencv_test_dnn",
8-
"opencv_test_features2d",
9-
"opencv_test_flann",
10-
"opencv_test_gapi",
11-
"opencv_test_highgui",
12-
"opencv_test_imgcodecs",
13-
"opencv_test_imgproc",
14-
"opencv_test_ml",
15-
"opencv_test_objdetect",
16-
"opencv_test_photo",
17-
"opencv_test_stitching",
18-
"opencv_test_video",
19-
"opencv_test_videoio",
20-
"opencv_perf_calib3d",
21-
"opencv_perf_core",
22-
"opencv_perf_dnn",
23-
"opencv_perf_features2d",
24-
"opencv_perf_gapi",
25-
"opencv_perf_imgcodecs",
26-
"opencv_perf_imgproc",
27-
"opencv_perf_objdetect",
28-
"opencv_perf_photo",
29-
"opencv_perf_stitching",
30-
"opencv_perf_video",
31-
"opencv_perf_videoio"
32-
],
33-
34-
"linux-contrib-4.x": [
35-
"opencv_test_bgsegm",
36-
"opencv_test_bioinspired",
37-
"opencv_test_dnn_superres",
38-
"opencv_test_face",
39-
"opencv_test_fuzzy",
40-
"opencv_test_hdf",
41-
"opencv_test_img_aug",
42-
"opencv_test_img_hash",
43-
"opencv_test_intensity_transform",
44-
"opencv_test_line_descriptor",
45-
"opencv_test_mcc",
46-
"opencv_test_optflow",
47-
"opencv_test_phase_unwrapping",
48-
"opencv_test_quality",
49-
"opencv_test_rapid",
50-
"opencv_test_reg",
51-
"opencv_test_rgbd",
52-
"opencv_test_saliency",
53-
"opencv_test_sfm",
54-
"opencv_test_shape",
55-
"opencv_test_stereo",
56-
"opencv_test_structured_light",
57-
"opencv_test_superres",
58-
"opencv_test_text",
59-
"opencv_test_tracking",
60-
"opencv_test_videostab",
61-
"opencv_test_wechat_qrcode",
62-
"opencv_test_xfeatures2d",
63-
"opencv_test_ximgproc",
64-
"opencv_test_xphoto",
65-
"opencv_perf_bioinspired",
66-
"opencv_perf_dnn_superres",
67-
"opencv_perf_features2d",
68-
"opencv_perf_line_descriptor",
69-
"opencv_perf_optflow",
70-
"opencv_perf_reg",
71-
"opencv_perf_rgbd",
72-
"opencv_perf_stereo",
73-
"opencv_perf_superres",
74-
"opencv_perf_tracking",
75-
"opencv_perf_xfeatures2d",
76-
"opencv_perf_ximgproc",
77-
"opencv_perf_xphoto"
78-
],
794

80-
"linux-5.x": [
5+
"linux": [
816
"opencv_test_3d",
827
"opencv_test_calib",
838
"opencv_test_core",
@@ -109,7 +34,7 @@
10934
"opencv_perf_videoio"
11035
],
11136

112-
"linux-contrib-5.x": [
37+
"linux-contrib": [
11338
"opencv_test_bgsegm",
11439
"opencv_test_bioinspired",
11540
"opencv_test_dnn_superres",

0 commit comments

Comments
 (0)