Skip to content

Commit c6908e5

Browse files
Added testing to the new Windows CI (#264)
* Added testing to the new Windows CI * Disabled fail-fast strategy for matrix build. * test: windows specifics * test: use workdir on windows * test: python executable, windows plans * windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * fixup! windows: build release * Disable ARM builds and tests on Windows for now. --------- Co-authored-by: Maksim Shabunin <maksim.shabunin@gmail.com>
1 parent a78e212 commit c6908e5

File tree

7 files changed

+287
-17
lines changed

7 files changed

+287
-17
lines changed

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

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
- branch_eval
4747
strategy:
4848
# NOTE: Debugging
49-
fail-fast: true
50-
# fail-fast: false
51-
max-parallel: 3
49+
# fail-fast: true
50+
fail-fast: false
51+
max-parallel: 2
5252
matrix:
53-
arch: [ x86, x64, arm64 ]
53+
arch: [ x86, x64 ] # , arm64
5454
config: [ base ]
5555
include:
5656
- arch: x86
@@ -126,7 +126,7 @@ jobs:
126126
source_branch: "${{ github.event.repository.name == 'ci-gha-workflow' && '' || github.head_ref }}"
127127
gitcache: '${{ env.GIT_CACHE }}'
128128
workdir: '${{ github.workspace }}'
129-
129+
130130
- name: Update extra dnn models
131131
if: ${{ matrix.arch != 'arm64' }}
132132
timeout-minutes: 60
@@ -152,4 +152,29 @@ jobs:
152152
workdir: '${{ github.workspace }}'
153153
builddir: 'build-contrib'
154154
generator: '${{ matrix.vs }}'
155-
options: '-A ${{ matrix.cmake_arch }} -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}'
155+
options: '-A ${{ matrix.cmake_arch }} -DCMAKE_BUILD_TYPE=Release -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}'
156+
157+
- name: Run OpenCV tests
158+
uses: ./run-tests
159+
env:
160+
OPENCV_TEST_DATA_PATH: '${{ github.workspace }}/opencv_extra/testdata'
161+
OPENCV_TEST_REQUIRE_DATA: 1
162+
OPENCV_TEST_CHECK_OPTIONAL_DATA: 1
163+
PYTHONPATH: '${{ github.workspace }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH'
164+
with:
165+
workdir: '${{ github.workspace }}'
166+
builddir: '${{ env.MAIN_BUILD_DIR }}'
167+
logdir: '${{ github.workspace }}'
168+
plan: "test-plan-win-${{ matrix.branch }}.json"
169+
suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''contrib''' || '''main''' }} ]"
170+
enable_python: "false"
171+
enable_java: "false"
172+
filter: "[ 'windows-common' ]"
173+
suffix: '${{ matrix.arch }}_${{ matrix.branch }}'
174+
timeout: 15
175+
176+
- if: ${{ always() && env.WARNINGS == '1' }}
177+
name: Warnings check
178+
run: |
179+
echo "::error Warnings have been found!"
180+
exit 1

configure-and-build/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,22 @@ runs:
3232
- working-directory: ${{ inputs.workdir }}
3333
shell: bash
3434
run: |
35+
set -x
3536
echo "::group::Build"
36-
cmake --build '${{ inputs.builddir }}' 2>&1 | tee '${{ inputs.builddir }}/log.txt'
37+
if [ "$RUNNER_OS" == "Windows" ]; then
38+
cfg="--config Release"
39+
fi
40+
cmake --build '${{ inputs.builddir }}' ${cfg} 2>&1 | tee '${{ inputs.builddir }}/log.txt'
3741
echo "::endgroup::"
3842
3943
- shell: bash
4044
run: |
45+
pyexe=python3
46+
if [ "$RUNNER_OS" == "Windows" ]; then
47+
pyexe=python
48+
fi
4149
set +e
42-
python3 ./scripts/warnings-handling.py \
50+
${pyexe} ./scripts/warnings-handling.py \
4351
'${{ inputs.workdir }}/${{ inputs.builddir }}/log.txt'
4452
if [ $? -ne 0 ]; then
4553
echo "WARNINGS=1" >> $GITHUB_ENV

run-tests/action.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ inputs:
1313
description: "Test plan (relative to scripts subfolder)"
1414
suite:
1515
description: "Suite in test plan (gtest) (JSON list)"
16+
default: "default"
1617
filter:
1718
description: "Filter(s) in test plan (gtest) (JSON list)"
19+
default: "default"
1820
timeout:
1921
description: "One test timeout (min)"
2022
default: "10"
@@ -40,15 +42,21 @@ runs:
4042
shell: bash
4143
run: |
4244
echo "### Test summary:" >> $GITHUB_STEP_SUMMARY
43-
python3 scripts/runner.py \
44-
'--workdir=${{ inputs.workdir }}/${{ inputs.builddir }}' \
45+
pyexe=python3
46+
if [ "$RUNNER_OS" == "Windows" ]; then
47+
pyexe=python
48+
opt="--exesuffix=.exe --bindir=bin/Release"
49+
fi
50+
${pyexe} scripts/runner.py \
4551
'--bindir=bin' \
52+
'--workdir=${{ inputs.workdir }}/${{ inputs.builddir }}' \
4653
'--logdir=${{ inputs.logdir }}' \
4754
'--plan=scripts/${{ inputs.plan }}' \
4855
'--timeout=${{ inputs.timeout }}' \
49-
--suite=${{ join(fromJSON(inputs.suite), ' --suite=') }} \
50-
--filter=${{ join(fromJSON(inputs.filter), ' --filter=') }} \
5156
'--options=${{ inputs.options }}' \
57+
--filter=${{ join(fromJSON(inputs.filter), ' --filter=') }} \
58+
--suite=${{ join(fromJSON(inputs.suite), ' --suite=') }} \
59+
${opt} \
5260
"--summary=$GITHUB_STEP_SUMMARY"
5361
5462
# Logs
@@ -68,16 +76,24 @@ runs:
6876
working-directory: ${{ inputs.workdir }}/${{ inputs.builddir }}
6977
run: |
7078
echo "::group::Python test"
71-
python3 ../opencv/modules/python/test/test.py --repo ../opencv -v
79+
pyexe=python3
80+
if [ "$RUNNER_OS" == "Windows" ]; then
81+
pyexe=python
82+
fi
83+
${pyexe} ../opencv/modules/python/test/test.py --repo ../opencv -v
7284
echo "::endgroup::"
7385
7486
- if: ${{ always() && fromJSON(inputs.enable_python) }}
7587
shell: bash
7688
working-directory: ${{ inputs.workdir }}/${{ inputs.builddir }}
7789
run: |
7890
echo "::group::Python app test"
91+
pyexe=python3
92+
if [ "$RUNNER_OS" == "Windows" ]; then
93+
pyexe=python
94+
fi
7995
if [ -f "../opencv/apps/python_app_test.py" ]; then
80-
python3 "../opencv/apps/python_app_test.py" --repo ../opencv -v
96+
${pyexe} "../opencv/apps/python_app_test.py" --repo ../opencv -v
8197
fi
8298
echo "::endgroup::"
8399
@@ -89,7 +105,11 @@ runs:
89105
working-directory: ${{ inputs.workdir }}/${{ inputs.builddir }}
90106
run: |
91107
echo "::group::Java test"
92-
${{ inputs.wrapper }} python3 ../opencv/modules/ts/misc/run.py . -a -t java
108+
pyexe=python3
109+
if [ "$RUNNER_OS" == "Windows" ]; then
110+
pyexe=python
111+
fi
112+
${{ inputs.wrapper }} ${pyexe} ../opencv/modules/ts/misc/run.py . -a -t java
93113
echo "::endgroup::"
94114
95115
# Logs

scripts/runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ async def run_one(name, cmd, logname, env, args):
141141
parser.add_argument("--bindir", default="bin", type=Path, help="Directory with binaries (relative to workdir)")
142142
parser.add_argument("--verbose", action='store_true', help="Output all lines")
143143
parser.add_argument("--summary", type=Path, help="Path to summary file to generate")
144+
parser.add_argument("--exesuffix", type=str, help="Suffix for executables (e.g. '.exe' or 'd.exe')")
144145
args = parser.parse_args()
145146

146147
if not args.logdir.is_absolute():
@@ -199,6 +200,8 @@ async def run_one(name, cmd, logname, env, args):
199200
extra_args.append("--gtest_filter=*:-{}".format(":".join(filter)))
200201

201202
actual_exe = args.workdir / args.bindir / Path(actual_exe)
203+
if args.exesuffix:
204+
actual_exe = actual_exe.with_suffix(args.exesuffix)
202205
if len(wrap) == 0 and (not actual_exe.exists() or not actual_exe.is_file()):
203206
print("Executable not found: {}".format(actual_exe))
204207
res = -3

scripts/test-plan-4.x.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"suites": {
33
"short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ],
44

5-
"linux": [
5+
"main": [
66
"opencv_test_calib3d",
77
"opencv_test_core",
88
"opencv_test_dnn",
@@ -32,7 +32,7 @@
3232
"opencv_perf_videoio"
3333
],
3434

35-
"linux-contrib": [
35+
"contrib": [
3636
"opencv_test_bgsegm",
3737
"opencv_test_bioinspired",
3838
"opencv_test_dnn_superres",

scripts/test-plan-win-4.x.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"suites": {
3+
"short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ],
4+
5+
"main": [
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+
"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+
"windows-common": {
83+
"test_core": [
84+
"Samples.findFile"
85+
],
86+
"test_videoio": [
87+
"videoio/videocapture_acceleration.read/yuv420p_libvpxxvp9_mp4_MSMF_NONE_MAT"
88+
],
89+
"perf_dnn": [
90+
"Utils_blobFromImages.HWC_TO_NCHW/6"
91+
]
92+
}
93+
},
94+
"options": {
95+
"default": {
96+
"args": {
97+
"test": "--skip_unstable=1",
98+
"perf": "--perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1"
99+
},
100+
"exe": {},
101+
"env": {}
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)