Skip to content

OCV Coverage:4.x U20 #153

OCV Coverage:4.x U20

OCV Coverage:4.x U20 #153

name: OCV Coverage:4.x U20
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/OCV-Coverage-4.x-U20.yaml'
workflow_call:
workflow_dispatch:
schedule:
- cron: '0 0 * * 6'
concurrency:
group: OCV-Coverage-4.x-U20-${{ github.ref }}
cancel-in-progress: true
env:
EXTRA_CMAKE_OPTIONS: '-DCMAKE_BUILD_TYPE=Debug -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DENABLE_COVERAGE=ON -DBUILD_SHARED_LIBS=ON -DCPU_DISPATCH= -DWITH_IPP=OFF -DBUILD_TESTS=ON -DWITH_OPENNI2=ON -DWITH_GDCM=ON -DCPU_BASELINE=HOST -DENABLE_CCACHE=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DWITH_GDAL=ON -DBUILD_PERF_TESTS=ON -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DWITH_OPENCL=OFF -DWITH_CUDA=OFF -DCPU_BASELINE=AVX2 -DCPU_DISPATCH='
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'
CCACHE_DIR: '/home/ci/.ccache'
jobs:
BuildAndTest:
runs-on: opencv-cn-lin-x86-64
timeout-minutes: 1440
defaults:
run:
shell: bash
container:
image: quay.io/opencv-ci/opencv-ubuntu:20.04-coverage
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: 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' || github.event_name == 'schedule' }}
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: 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/ci/opencv_extra
- 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/ci/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/ci/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/ci/build
cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }}
- name: Build OpenCV
timeout-minutes: 240
id: build-opencv
run: |
cd /home/ci/build
ninja
- name: Clean coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && rm -rf coverage_html tmp*.gcno
- name: Zero coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --zerocounters
- name: Init coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --capture --initial -o /home/ci/build/opencv_test_base.info
- name: Accuracy:calib3d
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_calib3d --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:core
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_core --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:dnn
timeout-minutes: 240
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_dnn --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:features2d
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_features2d --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:flann
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_flann --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:gapi
timeout-minutes: 180
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_gapi --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:highgui
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && xvfb-run -a bin/opencv_test_highgui --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:imgcodecs
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_imgcodecs --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:imgproc
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_imgproc --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:ml
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_ml --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:objdetect
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_objdetect --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:photo
timeout-minutes: 240
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_photo --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:stitching
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_stitching --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:video
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_video --test_threads=2 --test_tag_skip=size_hd
- name: Accuracy:videoio
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_test_videoio --test_threads=2 --test_tag_skip=size_hd
- name: Python3
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: |
cd /home/ci/build
python3 ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/python/test/test.py --repo ${{ env.OPENCV_DOCKER_WORKDIR }} -v
- name: Java
timeout-minutes: 60
id: java-test
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && xvfb-run -a python3 ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/ts/misc/run.py . -a -t java --test_threads=2 --test_tag_skip=size_hd
- 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
path: /home/ci/build/java_test/testResults/junit-noframes.html
- name: Run test coverage-aggregation
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --capture -o /home/ci/build/opencv_test.info
- name: Combine test coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov -a /home/ci/build/opencv_test_base.info -a /home/ci/build/opencv_test.info -o /home/ci/build/opencv_test_total.info
- name: Filter test coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --remove /home/ci/build/opencv_test_total.info '/usr/include/*' '/usr/lib/*' '/usr/local/include/*' '*/opencv/apps/*' '*/opencv/samples/*' '*/opencv/3rdparty/*' '*/opencv/modules/ts/*' '*/opencv/modules/*/perf/*' '*/opencv/modules/*/test/*' '*/opencv/modules/*/samples/*' '*/home/ci/build/modules/java_bindings_generator/*' '*/home/ci/build/modules/python_bindings_generator/*' '*/opencv_contrib/modules/*/perf/*' '*/opencv_contrib/modules/*/test/*' '*/opencv_contrib/modules/*/samples/*' '*/opencv_contrib/*' '/home/ci/build/build/*' -o /home/ci/build/opencv_test_filtered.info
- name: Generate test coverage report
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
id: coverage-test-report
run: |
cd /home/ci/build
genhtml --prefix /home/ci -t "OpenCV: ${{ env.TARGET_BRANCH_NAME }}-$GITHUB_SHA" -o /home/ci/build/test_coverage_html /home/ci/build/opencv_test_filtered.info
- name: Upload test coverage
timeout-minutes: 60
uses: actions/upload-artifact@v3
if: ${{ always() && steps.coverage-test-report.outcome == 'success' && steps.build-opencv.outcome == 'success' }}
with:
name: test-coverage-html
path: /home/ci/build/test_coverage_html
- name: Clean coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && rm -rf coverage_html tmp*.gcno
- name: Zero coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --zerocounters
- name: Init coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --capture --initial -o /home/ci/build/opencv_perf_base.info
- name: Performance:calib3d
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_calib3d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:core
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_core --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:dnn
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_dnn --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:features2d
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_features2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:gapi
timeout-minutes: 180
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_gapi --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:imgcodecs
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_imgcodecs --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:imgproc
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_imgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:objdetect
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_objdetect --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:photo
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_photo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:stitching
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_stitching --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:video
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_video --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Performance:videoio
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && ./bin/opencv_perf_videoio --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --test_threads=2 --test_tag_skip=size_hd
- name: Run perf coverage-aggregation
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --directory /home/ci/build --capture -o /home/ci/build/opencv_perf.info
- name: Combine perf coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov -a /home/ci/build/opencv_perf_base.info -a /home/ci/build/opencv_perf.info -o /home/ci/build/opencv_perf_total.info
- name: Filter perf coverage
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: cd /home/ci/build && lcov --remove /home/ci/build/opencv_perf_total.info '/usr/include/*' '/usr/lib/*' '/usr/local/include/*' '*/opencv/apps/*' '*/opencv/samples/*' '*/opencv/3rdparty/*' '*/opencv/modules/ts/*' '*/opencv/modules/*/perf/*' '*/opencv/modules/*/test/*' '*/opencv/modules/*/samples/*' '*/home/ci/build/modules/java_bindings_generator/*' '*/home/ci/build/modules/python_bindings_generator/*' '*/opencv_contrib/modules/*/perf/*' '*/opencv_contrib/modules/*/test/*' '*/opencv_contrib/modules/*/samples/*' '*/opencv_contrib/*' '/home/ci/build/build/*' -o /home/ci/build/opencv_perf_filtered.info
- name: Generate perf coverage report
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
id: coverage-perf-report
run: |
cd /home/ci/build
genhtml --prefix /home/ci -t "OpenCV: ${{ env.TARGET_BRANCH_NAME }}-$GITHUB_SHA" -o /home/ci/build/perf_coverage_html /home/ci/build/opencv_perf_filtered.info
- name: Upload perf coverage
timeout-minutes: 60
uses: actions/upload-artifact@v3
if: ${{ always() && steps.coverage-perf-report.outcome == 'success' && steps.build-opencv.outcome == 'success' }}
with:
name: perf-coverage-html
path: /home/ci/build/perf_coverage_html