diff --git a/.github/workflows/OCV-Contrib-PR-4.x-U22.yaml b/.github/workflows/OCV-Contrib-PR-4.x-U22.yaml new file mode 100644 index 00000000..70629b49 --- /dev/null +++ b/.github/workflows/OCV-Contrib-PR-4.x-U22.yaml @@ -0,0 +1,456 @@ +name: OCV Contrib PR:4.x U22 + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/OCV-Contrib-PR-4.x-U22.yaml' + workflow_call: + +concurrency: + group: OCV-Contrib-PR-4.x-U20-${{ 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' + 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' + PYTHONPATH: /home/ci/build/python_loader:$PYTHONPATH + OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata' + OPENCV_CONTRIB_DOCKER_WORKDIR: '/home/ci/opencv_contrib' + DNN_MODELS: '/home/ci/dnn-models' + # GStreamer 1.20 distributed with Ubuntu 22.04 as bug in JPEG integration + # Details: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1122 + # G-API bug with GCC 11+: https://github.com/opencv/opencv/issues/19678 + GTEST_FILTER_STRING: '-tracking_GOTURN.GOTURN/*:videoio/videoio_synthetic.write_read_position/10:videoio/videoio_synthetic.write_read_position/13:videoio/videoio_synthetic.write_read_position/26:videoio/videoio_synthetic.write_read_position/29:videoio/videocapture_acceleration.read/24:videoio/videocapture_acceleration.read/26:AsyncAPICancelation/*' + PARALLEL_JOBS: 8 + +jobs: + BuildAndTest: + runs-on: opencv-cn-lin-x86-64 + defaults: + run: + shell: bash + container: + image: quay.io/opencv-ci/opencv-ubuntu-22.04:20230602 + volumes: + - /home/opencv-cn/git_cache:/home/ci/git_cache + - /home/opencv-cn/ci_cache/opencv_contrib:/home/ci/.ccache + - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache + - /home/opencv-cn/dnn-models:/home/ci/dnn-models + 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: 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: Extra DNN models update + timeout-minutes: 60 + run: | + DOWNLOAD_MODELS_FILE='download_models.py' + LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) + LATEST_HASH=$(sha256sum $HOME/opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') + if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then + echo "DNN models are up to date" + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + else + echo "Updating DNN models list" + echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' + mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" + rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH + cp $HOME/opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn + cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py + 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 + - name: Warnings check + timeout-minutes: 60 + run: cd $HOME/build && python3 $HOME/scripts/warnings-handling.py + - name: Accuracy:aruco + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_aruco --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:bgsegm + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_bgsegm --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:bioinspired + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_bioinspired --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:calib3d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_calib3d --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:core + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_core --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:dnn + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_dnn --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:dnn_superres + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_dnn_superres --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:face + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_face --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:features2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_features2d --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:flann + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_flann --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:fuzzy + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_fuzzy --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:gapi + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_gapi --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:hdf + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_hdf --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:highgui + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_highgui --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:img_hash + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_img_hash --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:img_aug + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: | + cd $HOME/build + if [[ -f bin/opencv_test_imgaug ]]; then + xvfb-run -a bin/opencv_test_imgaug --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + else + echo "No Augmentation module" + fi + - name: Accuracy:imgcodecs + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_imgcodecs --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:imgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_imgproc --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:intensity_transform + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_intensity_transform --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:line_descriptor + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_line_descriptor --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:mcc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_mcc --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:ml + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_ml --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:objdetect + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_objdetect --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:optflow + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_optflow --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:phase_unwrapping + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_phase_unwrapping --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:photo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_photo --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:quality + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_quality --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:rapid + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_rapid --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:reg + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_reg --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:rgbd + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_rgbd --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:saliency + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_saliency --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:sfm + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_sfm --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:shape + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_shape --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:stereo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_stereo --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:stitching + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_stitching --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:structured_light + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_structured_light --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:superres + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_superres --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:text + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_text --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:tracking + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_tracking --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:video + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_video --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:videoio + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_videoio --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:videostab + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_videostab --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:wechat_qrcode + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_wechat_qrcode --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:xfeatures2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_xfeatures2d --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:ximgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_ximgproc --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Accuracy:xphoto + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_xphoto --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:aruco + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_aruco --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:bioinspired + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_bioinspired --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:calib3d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_calib3d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:core + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_core --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:dnn + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_dnn --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:dnn_superres + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_dnn_superres --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:features2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_features2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:gapi + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_gapi --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:imgcodecs + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_imgcodecs --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:imgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_imgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:line_descriptor + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_line_descriptor --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:objdetect + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_objdetect --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:optflow + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_optflow --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:photo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_photo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:reg + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_reg --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:rgbd + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_rgbd --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:stereo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_stereo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:stitching + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_stitching --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:superres + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_superres --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:tracking + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_tracking --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:video + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_video --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:videoio + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_videoio --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:xfeatures2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_xfeatures2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:ximgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_ximgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:xphoto + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_xphoto --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Python3 Bindings + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: | + cd $HOME/build + python3 $HOME/opencv/modules/python/test/test.py --repo $HOME/opencv -v + - name: Python3 Apps + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: | + cd $HOME/build + if [ -f "$HOME/opencv/apps/python_app_test.py" ]; then + python3 "$HOME/opencv/apps/python_app_test.py" --repo $HOME/opencv -v + fi + - name: Java + timeout-minutes: 60 + id: java-test + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a python3 $HOME/opencv/modules/ts/misc/run.py . -a -t java + - name: Save Unit Test Results + timeout-minutes: 60 + uses: actions/upload-artifact@v3 + if: ${{ always() && steps.java-test.outcome == 'success' && steps.build-opencv-contrib.outcome == 'success' }} + with: + name: junit-html-ubuntu22-x86-64 + path: /home/ci/build/java_test/testResults/junit-noframes.html + - name: Pylint + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} + run: cd $HOME/build && cmake --build . --config release --target check_pylint -- -j4 diff --git a/.github/workflows/OCV-PR-4.x-U22.yaml b/.github/workflows/OCV-PR-4.x-U22.yaml new file mode 100644 index 00000000..e12bc5e7 --- /dev/null +++ b/.github/workflows/OCV-PR-4.x-U22.yaml @@ -0,0 +1,333 @@ +name: OCV PR:4.x U22 + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/OCV-PR-4.x-U22.yaml' + workflow_call: + +concurrency: + group: OCV-PR-4.x-U22-${{ 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' + 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' + PYTHONPATH: /home/ci/build/python_loader:$PYTHONPATH + OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata' + OPENCV_DOCKER_WORKDIR: '/home/ci/opencv' + DNN_MODELS: '/home/ci/dnn-models' + PARALLEL_JOBS: 8 + +jobs: + BuildAndTest: + runs-on: opencv-cn-lin-x86-64 + defaults: + run: + shell: bash + container: + image: quay.io/opencv-ci/opencv-ubuntu-22.04:20230602 + 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 + - /home/opencv-cn/dnn-models:/home/ci/dnn-models + 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_DOCKER_WORKDIR }} -mindepth 1 -delete + - name: Fetch opencv + timeout-minutes: 60 + run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} + - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch + timeout-minutes: 60 + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} + run: | + cd ${{ env.OPENCV_DOCKER_WORKDIR }} + git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" + - 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: Extra DNN models update + timeout-minutes: 60 + run: | + DOWNLOAD_MODELS_FILE='download_models.py' + LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) + LATEST_HASH=$(sha256sum $HOME/opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') + if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then + echo "DNN models are up to date" + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + else + echo "Updating DNN models list" + echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' + mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" + rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH + cp $HOME/opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn + cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py + fi + - name: Configure OpenCV + timeout-minutes: 60 + run: | + cd $HOME/build + cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }} + - name: Build OpenCV + timeout-minutes: 60 + id: build-opencv + run: | + cd $HOME/build + ninja -j ${{ env.PARALLEL_JOBS }} | tee $HOME/build/build-log.txt + - name: Warnings check + timeout-minutes: 60 + run: cd $HOME/build && python3 $HOME/scripts/warnings-handling.py + - name: Accuracy:calib3d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_calib3d --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:core + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_core --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:dnn + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_dnn --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:features2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_features2d --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:flann + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_flann --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:gapi + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + # G-API bug with GCC 11+: https://github.com/opencv/opencv/issues/19678 + run: cd $HOME/build && xvfb-run -a bin/opencv_test_gapi --gtest_filter='-AsyncAPICancelation/cancel/*' --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:highgui + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_highgui --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:imgcodecs + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_imgcodecs --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:imgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_imgproc --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:ml + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_ml --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:objdetect + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_objdetect --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:photo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_photo --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:stitching + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_stitching --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:video + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_test_video --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Accuracy:videoio + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + # GStreamer 1.20 distributed with Ubuntu 22.04 as bug in JPEG integration + # Details: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1122 + run: cd $HOME/build && xvfb-run -a bin/opencv_test_videoio --gtest_filter='-videoio/videoio_synthetic.write_read_position/10:videoio/videoio_synthetic.write_read_position/13:videoio/videoio_synthetic.write_read_position/26:videoio/videoio_synthetic.write_read_position/29:videoio/videocapture_acceleration.read/24:videoio/videocapture_acceleration.read/26' --test_threads=${{ env.PARALLEL_JOBS }} ${{ env.EXTRA_GTEST_OPTIONS }} + - name: Performance:calib3d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_calib3d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:core + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_core --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:dnn + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_dnn --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:features2d + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_features2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:gapi + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_gapi --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:imgcodecs + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_imgcodecs --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:imgproc + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_imgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:objdetect + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_objdetect --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:photo + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_photo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:stitching + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_stitching --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:video + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_video --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Performance:videoio + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_videoio --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} + - name: Python3 Bindings + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: | + cd $HOME/build + python3 $HOME/opencv/modules/python/test/test.py --repo $HOME/opencv -v + - name: Python3 Apps + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: | + cd $HOME/build + if [ -f "$HOME/opencv/apps/python_app_test.py" ]; then + python3 "$HOME/opencv/apps/python_app_test.py" --repo $HOME/opencv -v + fi + - name: Java + timeout-minutes: 60 + id: java-test + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && xvfb-run -a python3 ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/ts/misc/run.py . -a -t java + - name: Save Unit Test Results + timeout-minutes: 60 + uses: actions/upload-artifact@v3 + if: ${{ always() && steps.java-test.outcome == 'success' && steps.build-opencv.outcome == 'success' }} + with: + name: junit-html-ubuntu22-x86-64 + path: /home/ci/build/java_test/testResults/junit-noframes.html + - name: Pylint + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + run: cd $HOME/build && cmake --build . --config release --target check_pylint -- -j4 + + BuildContrib: + runs-on: opencv-cn-lin-x86-64 + defaults: + run: + shell: bash + container: + image: quay.io/opencv-ci/opencv-ubuntu-22.04:20230602 + 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 + 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: 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_DOCKER_WORKDIR }} -mindepth 1 -delete + - name: Fetch opencv + timeout-minutes: 60 + run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} + - name: Merge opencv with a test branch + timeout-minutes: 60 + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} + run: | + cd ${{ env.OPENCV_DOCKER_WORKDIR }} + git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" + - name: Clone opencv_contrib + timeout-minutes: 60 + run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_contrib.git https://github.com/opencv/opencv_contrib.git $HOME/opencv_contrib + - name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch + timeout-minutes: 60 + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} + run: | + OPENCV_CONTRIB_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true + if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then + echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" + cd $HOME/opencv_contrib + git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" + else + echo "No merge since ${{ env.PR_AUTHOR }}/opencv_contrib does not have branch ${{ env.SOURCE_BRANCH_NAME }}" + fi + - name: Configure OpenCV Contrib + timeout-minutes: 60 + run: | + cd $HOME/build + cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=$HOME/opencv_contrib/modules ${{ env.OPENCV_DOCKER_WORKDIR }} + - name: Build OpenCV Contrib + timeout-minutes: 60 + run: | + cd $HOME/build + ninja -j ${{ env.PARALLEL_JOBS }} | tee $HOME/build/build-log.txt + - name: Warnings check + timeout-minutes: 60 + run: cd $HOME/build && python3 $HOME/scripts/warnings-handling.py