Force OPENCV_TEST_REQUIRE_DATA in CI environments in 4.x #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OCV Contrib PR:4.x U20 CUDA | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/OCV-Contrib-PR-4.x-U20-Cuda.yaml' | |
workflow_call: | |
concurrency: | |
group: OCV-Contrib-PR-4.x-U20-Cuda-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_CUDA=ON -DWITH_NVCUVID=ON -DCUDA_ARCH_BIN=6.1 -DWITH_VA=OFF -DCUDA_CUDA_LIBRARY=/lib/x86_64-linux-gnu/libcuda.so.1 -DCUDA_nvcuvid_LIBRARY=/lib/x86_64-linux-gnu/libnvcuvid.so.1' | |
PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} | |
SOURCE_BRANCH_NAME: ${{ github.head_ref }} | |
TARGET_BRANCH_NAME: ${{ github.base_ref }} | |
ANT_HOME: '/usr/share/ant' | |
GIT_CACHE_DOCKER: '/home/ci/git_cache' | |
OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata' | |
OPENCV_TEST_REQUIRE_DATA: 1 | |
OPENCV_CONTRIB_DOCKER_WORKDIR: '/home/ci/opencv_contrib' | |
PARALLEL_JOBS: 8 | |
jobs: | |
BuildAndTest: | |
runs-on: opencv-cn-lin-x86-64 | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: quay.io/opencv-ci/opencv-ubuntu-20.04:20230413 | |
options: --gpus all -m 8G | |
volumes: | |
- /home/opencv-cn/git_cache:/home/ci/git_cache | |
- /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache | |
- /home/opencv-cn/binaries_cache:/home/ci/binaries_cache | |
- /usr/local/cuda:/usr/local/cuda | |
- /lib/x86_64-linux-gnu/libnvidia-encode.so.1:/lib/x86_64-linux-gnu/libnvidia-encode.so.1 | |
- /lib/x86_64-linux-gnu/libnvcuvid.so.1:/lib/x86_64-linux-gnu/libnvcuvid.so.1 | |
steps: | |
- name: Brief system information | |
timeout-minutes: 60 | |
run: bash ${{ env.GIT_CACHE_DOCKER }}/print_system_information.sh | |
- name: Define proper HOME path | |
timeout-minutes: 60 | |
run: echo "HOME=/home/ci" >> $GITHUB_ENV | |
- name: Setup infra environment | |
timeout-minutes: 60 | |
if: ${{ github.event.repository.name == 'ci-gha-workflow' }} | |
run: echo "TARGET_BRANCH_NAME=4.x" >> $GITHUB_ENV | |
- name: Setup test environment | |
if: ${{ github.event.repository.name != 'ci-gha-workflow' }} | |
run: echo "EXTRA_GTEST_OPTIONS=--skip_unstable=1" >> $GITHUB_ENV | |
- name: PR info | |
timeout-minutes: 60 | |
run: | | |
echo "PR Author: ${{ env.PR_AUTHOR }}" | |
echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" | |
echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" | |
echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" | |
- name: Clean | |
timeout-minutes: 60 | |
run: find ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} -mindepth 1 -delete | |
- name: Fetch opencv_contrib | |
timeout-minutes: 60 | |
run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_contrib.git https://github.com/opencv/opencv_contrib.git ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} | |
- name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch | |
timeout-minutes: 60 | |
if: ${{ github.event.repository.name != 'ci-gha-workflow' }} | |
run: | | |
cd ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} | |
git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" | |
- name: Clone opencv | |
timeout-minutes: 60 | |
run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git $HOME/opencv | |
- name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch | |
timeout-minutes: 60 | |
if: ${{ github.event.repository.name != 'ci-gha-workflow' }} | |
run: | | |
OPENCV_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv" "${{ env.SOURCE_BRANCH_NAME }}") || true | |
if [[ ! -z "$OPENCV_FORK" ]]; then | |
echo "Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch" | |
cd $HOME/opencv | |
git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv" "${{ env.SOURCE_BRANCH_NAME }}" | |
else | |
echo "No merge since ${{ env.PR_AUTHOR }}/opencv does not have branch ${{ env.SOURCE_BRANCH_NAME }}" | |
fi | |
- name: Clone opencv_extra | |
timeout-minutes: 60 | |
run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git https://github.com/opencv/opencv_extra.git $HOME/opencv_extra | |
- name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch | |
timeout-minutes: 60 | |
if: ${{ github.event.repository.name != 'ci-gha-workflow' }} | |
run: | | |
OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true | |
if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then | |
echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" | |
cd $HOME/opencv_extra | |
git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" | |
else | |
echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" | |
fi | |
- name: Configure OpenCV | |
timeout-minutes: 60 | |
run: | | |
cd $HOME/build | |
cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }}/modules $HOME/opencv | |
- name: Build OpenCV | |
timeout-minutes: 60 | |
id: build-opencv-contrib | |
run: | | |
cd $HOME/build | |
ninja -j ${{ env.PARALLEL_JOBS }} | tee $HOME/build/build-log.txt | |
# Tests are not stable, failures after 'CUDA/GpuMat_SetTo.Zero' test happen everytime | |
# The issue in CUDA_Event/AsyncEvent.Timing/* | |
# https://github.com/opencv/opencv_contrib/issues/3361 | |
# - name: Accuracy:cudaarithm | |
# timeout-minutes: 60 | |
# if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
# run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaarithm --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudabgsegm | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudabgsegm --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudacodec | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudacodec --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-CUDA_Codec/CheckKeyFrame.Reader/8:CUDA_Codec/CheckKeyFrame.Reader/9:CUDA_Codec/Video.Reader/8:CUDA_Codec/Video.Reader/9' | |
- name: Accuracy:cudafeatures2d | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudafeatures2d --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudafilters | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudafilters --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudaimgproc | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaimgproc --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/1:CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/2:CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/3:CUDA_ImgProc/HoughCircles.Accuracy/0' | |
- name: Accuracy:cudalegacy | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudalegacy --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudaobjdetect | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaobjdetect --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudaoptflow | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaoptflow --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-CUDA_OptFlow/NvidiaOpticalFlow_1_0.Regression/0:CUDA_OptFlow/NvidiaOpticalFlow_1_0.OpticalFlowNan/0:CUDA_OptFlow/NvidiaOpticalFlow_2_0.Regression/0:CUDA_OptFlow/NvidiaOpticalFlow_2_0.OpticalFlowNan/0' | |
- name: Accuracy:cudastereo | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudastereo --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudawarping | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudawarping --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Accuracy:cudev | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudev --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} | |
- name: Performance:cudaarithm | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaarithm --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-Sz_Type_AngleInDegrees_PolarToCart.PolarToCart/0:Sz_Type_AngleInDegrees_PolarToCart.PolarToCart/4' | |
- name: Performance:cudabgsegm | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudabgsegm --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudacodec | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudacodec --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudafeatures2d | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudafeatures2d --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudafilters | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudafilters --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudaimgproc | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaimgproc --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-Sz_Depth_Code_CvtColor.CvtColor/17:Sz_Depth_Code_CvtColor.CvtColor/38:Sz_Depth_Code_CvtColor.CvtColor/39:Sz_Depth_Code_CvtColor.CvtColor/40:Sz_Depth_Code_CvtColor.CvtColor/41:Sz_Depth_Code_CvtColor.CvtColor/59:Sz_Depth_Code_CvtColor.CvtColor/80:Sz_Depth_Code_CvtColor.CvtColor/81:Sz_Depth_Code_CvtColor.CvtColor/82:Sz_Depth_Code_CvtColor.CvtColor/83:Sz_Depth_Code_CvtColor.CvtColor/101:Sz_Depth_Code_CvtColor.CvtColor/122:Sz_Depth_Code_CvtColor.CvtColor/123:Sz_Depth_Code_CvtColor.CvtColor/124:Sz_Depth_Code_CvtColor.CvtColor/125:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/12:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/13:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/14:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/15:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/28:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/29:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/30:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/31:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/44:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/45:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/46:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/47:Image_HoughLinesP.HoughLinesP/0:Image_HoughLinesP.HoughLinesP/1:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/46:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/47:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/52:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/53' | |
- name: Performance:cudalegacy | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudalegacy --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudaobjdetect | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaobjdetect --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudaoptflow | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaoptflow --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/0:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/1:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/2:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/3' | |
- name: Performance:cudastereo | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudastereo --perf_threads=${{ env.PARALLEL_JOBS }} | |
- name: Performance:cudawarping | |
timeout-minutes: 60 | |
if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} | |
run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudawarping --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} | |
env: | |
GTEST_FILTER_STRING: '-Sz_Depth_Cn_Inter_Rotate.Rotate/7:Sz_Depth_Cn_Inter_Rotate.Rotate/34:Sz_Depth_Cn_Inter_Rotate.Rotate/55' |