1
+ name : OCV PR:4.x macOS ARM64 Vulkan
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ paths :
8
+ - ' .github/workflows/OCV-PR-4.x-macOS-ARM64-Vulkan.yaml'
9
+ workflow_call :
10
+
11
+ concurrency :
12
+ group : OCV-PR-4.x-macOS-ARM64-Vulkan-${{ github.ref }}
13
+ cancel-in-progress : true
14
+
15
+ env :
16
+ EXTRA_CMAKE_OPTIONS : ' -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=$BINARIES_CACHE -DOPENCV_ENABLE_NONFREE=ON -DBUILD_ZLIB=OFF -DWITH_OPENCL=OFF -DWITH_VULKAN=ON'
17
+ PR_AUTHOR : ${{ github.event.pull_request.user.login }}
18
+ PR_AUTHOR_FORK : ${{ github.event.pull_request.head.repo.full_name }}
19
+ SOURCE_BRANCH_NAME : ${{ github.head_ref }}
20
+ TARGET_BRANCH_NAME : ${{ github.base_ref }}
21
+ ANT_HOME : ' /usr/share/ant'
22
+ PYTHONPATH : ' ${{ github.workspace }}/build/python_loader:$PYTHONPATH'
23
+ OPENCV_TEST_DATA_PATH : ' ${{ github.workspace }}/opencv_extra/testdata'
24
+ GTEST_FILTER_STRING : ' -GOTURN.memory_usage:DaSiamRPN.memory_usage:videoio_dynamic.basic_write:videoio/videocapture_acceleration.read/64:videoio/videocapture_acceleration.read/65:videoio/videocapture_acceleration.read/66:videoio/videocapture_acceleration.read/67'
25
+ OPENCV_VULKAN_RUNTIME : ' /opt/VulkanSDK/1.3.239.0/MoltenVK/dylib/macOS/libMoltenVK.dylib'
26
+
27
+ jobs :
28
+ BuildAndTest :
29
+ runs-on : opencv-cn-mac-arm64
30
+ defaults :
31
+ run :
32
+ shell : bash
33
+ steps :
34
+ - name : Brief system information
35
+ timeout-minutes : 60
36
+ run : bash $GIT_CACHE/print_system_information.sh
37
+ - name : Setup infra environment
38
+ timeout-minutes : 60
39
+ if : ${{ github.event.repository.name == 'ci-gha-workflow' }}
40
+ run : |
41
+ echo "TARGET_BRANCH_NAME=4.x" >> $GITHUB_ENV
42
+ - name : Setup test environment
43
+ if : ${{ github.event.repository.name != 'ci-gha-workflow' }}
44
+ run : |
45
+ echo "EXTRA_GTEST_OPTIONS=--skip_unstable=1" >> $GITHUB_ENV
46
+ - name : PR info
47
+ timeout-minutes : 60
48
+ run : |
49
+ echo "PR Author: ${{ env.PR_AUTHOR }}"
50
+ echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}"
51
+ echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}"
52
+ echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}"
53
+ - name : Clean
54
+ timeout-minutes : 60
55
+ run : find . -mindepth 1 -delete
56
+ working-directory : ${{ github.workspace }}
57
+ - name : Fetch opencv
58
+ timeout-minutes : 60
59
+ run : git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference $GIT_CACHE/opencv.git https://github.com/opencv/opencv.git
60
+ working-directory : ${{ github.workspace }}
61
+ - name : Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch
62
+ timeout-minutes : 60
63
+ if : ${{ github.event.repository.name != 'ci-gha-workflow' }}
64
+ run : git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}"
65
+ working-directory : ${{ github.workspace }}/opencv
66
+ - name : Clone opencv_extra
67
+ timeout-minutes : 60
68
+ run : git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference $GIT_CACHE/opencv_extra.git https://github.com/opencv/opencv_extra.git
69
+ working-directory : ${{ github.workspace }}
70
+ - name : Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch
71
+ timeout-minutes : 60
72
+ if : ${{ github.event.repository.name != 'ci-gha-workflow' }}
73
+ run : |
74
+ OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true
75
+ if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then
76
+ echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch"
77
+ git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}"
78
+ else
79
+ echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}"
80
+ fi
81
+ working-directory : ${{ github.workspace }}/opencv_extra
82
+ - name : Extra DNN models update
83
+ timeout-minutes : 60
84
+ run : |
85
+ DOWNLOAD_MODELS_FILE='download_models.py'
86
+ LATEST_SAVED_HASH=$(cat $DNN_MODELS/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt)
87
+ LATEST_HASH=$(sha256sum opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}')
88
+ if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then
89
+ echo "DNN models are up to date"
90
+ echo "OPENCV_DNN_TEST_DATA_PATH=$DNN_MODELS" >> $GITHUB_ENV
91
+ else
92
+ echo "Updating DNN models list"
93
+ echo "OPENCV_DNN_TEST_DATA_PATH=${{ github.workspace }}/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH="${{ github.workspace }}/new-dnn-models"
94
+ mkdir -p "$OPENCV_DNN_TEST_DATA_PATH"
95
+ rsync -a --exclude=$DOWNLOAD_MODELS_FILE $DNN_MODELS/* $OPENCV_DNN_TEST_DATA_PATH
96
+ cp opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn
97
+ cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py
98
+ fi
99
+ working-directory : ${{ github.workspace }}
100
+ - name : Configure OpenCV
101
+ timeout-minutes : 60
102
+ run : |
103
+ cmake -B build -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} opencv
104
+ working-directory : ${{ github.workspace }}
105
+ - name : Build OpenCV
106
+ timeout-minutes : 60
107
+ id : build-opencv
108
+ run : |
109
+ ninja -j $PARALLEL_JOBS | tee ${{ github.workspace }}/build/build-log.txt
110
+ working-directory : ${{ github.workspace }}/build
111
+ - name : Warnings check
112
+ timeout-minutes : 60
113
+ run : python3 $GIT_CACHE/warnings-handling.py
114
+ working-directory : ${{ github.workspace }}/build
115
+ - name : Accuracy:dnn
116
+ timeout-minutes : 60
117
+ if : ${{ always() && steps.build-opencv.outcome == 'success' }}
118
+ run : ./bin/opencv_test_dnn --gtest_filter=${{ env.GTEST_FILTER_STRING }} --test_threads=$PARALLEL_JOBS ${{ env.EXTRA_GTEST_OPTIONS }}
119
+ working-directory : ${{ github.workspace }}/build
120
+ - name : Performance:dnn
121
+ timeout-minutes : 60
122
+ if : ${{ always() && steps.build-opencv.outcome == 'success' }}
123
+ run : ./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=$PARALLEL_JOBS
124
+ working-directory : ${{ github.workspace }}/build
125
+ - name : Save Unit Test Results
126
+ timeout-minutes : 60
127
+ uses : actions/upload-artifact@v3
128
+ if : ${{ always() && steps.java-test.outcome == 'success' && steps.build-opencv.outcome == 'success' }}
129
+ with :
130
+ name : junit-html-macos-arm64
131
+ path : ${{ github.workspace }}/build/java_test/testResults/junit-noframes.html
0 commit comments