diff --git a/.github/workflows/OCV-PR-Linux-ORT.yaml b/.github/workflows/OCV-PR-Linux-ORT.yaml new file mode 100644 index 00000000..3d7c69da --- /dev/null +++ b/.github/workflows/OCV-PR-Linux-ORT.yaml @@ -0,0 +1,125 @@ +name: OCV PR Linux ORT + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/OCV-PR-Linux-ORT.yaml' + # TODO: are following paths necessary? + # - 'checkout-and-merge/*' + # - 'configure-and-build/*' + # - 'run-tests/*' + # - 'scripts/runner.py' + # - 'scripts/test-plan.json' + workflow_call: + inputs: + workflow_branch: + description: "Branch for ci-gha-workflow repository" + default: "main" + required: false + type: string + +concurrency: + group: OCV-PR-Linux-ORT-${{ github.ref }} + cancel-in-progress: true + +jobs: + + branch_eval: + runs-on: ubuntu-24.04 + outputs: + branches: ${{ steps.determine-branches.outputs.branches }} + steps: + - id: determine-branches + shell: bash + run: | + if [[ "${{ github.event.repository.name }}" == "ci-gha-workflow" || "${{ github.base_ref }}" == "5.x" ]]; then + echo "branches=['5.x']" >> "$GITHUB_OUTPUT" + else + echo "branches=[]" >> "$GITHUB_OUTPUT" + fi + + Ubuntu: + runs-on: opencv-cn-lin-x86-64 + needs: + - branch_eval + if: ${{ needs.branch_eval.outputs.branches != '[]' }} + defaults: + run: + shell: bash + container: + image: 'quay.io/opencv-ci/opencv-ubuntu-24.04:20251127' + volumes: + - /home/opencv-cn/git_cache:/opt/git_cache + - /home/opencv-cn/ci_cache/opencv/24.04:/opt/.ccache + - /home/opencv-cn/binaries_cache/24.04:/opt/binaries_cache + - /home/opencv-cn/dnn-models:/opt/dnn-models + env: + ANT_HOME: '/usr/share/ant' + DNN_MODELS: '/opt/dnn-models' + CCACHE_DIR: '/opt/.ccache' + CCACHE_MAXSIZE: '8G' + OPENCV_DOWNLOAD_PATH: '/opt/binaries_cache' + CMAKE_OPT: >- + -DWITH_ONNXRUNTIME=ON + HOME: '/home/ubuntu' + MAIN_BUILD_DIR: "build" + OPENCV_FOR_THREADS_NUM: 8 + CMAKE_BUILD_PARALLEL_LEVEL: 8 + + steps: + - name: Checkout workflow repository + uses: actions/checkout@v4 + with: + repository: opencv/ci-gha-workflow + ref: "${{ github.repository == 'opencv/ci-gha-workflow' && github.ref || inputs.workflow_branch }}" + + - name: Checkout and merge OpenCV + uses: ./checkout-and-merge + with: + target_branch: "5.x" + author: "${{ github.event.pull_request.user.login }}" + source_branch: "${{ github.event.repository.name == 'ci-gha-workflow' && '' || github.head_ref }}" + gitcache: '/opt/git_cache' + home: '${{ env.HOME }}' + workdir: '${{ env.HOME }}' + + - name: Update extra dnn models + timeout-minutes: 60 + working-directory: '${{ env.HOME }}' + run: | + ls -lR ${{ env.DNN_MODELS }} + python3 opencv_extra/testdata/dnn/download_models.py \ + --cleanup \ + --dst '${{ env.DNN_MODELS }}/dnn' + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + + - name: Configure and build OpenCV + id: build-opencv + uses: ./configure-and-build + with: + workdir: '${{ env.HOME }}' + builddir: 'build' + generator: 'Ninja' + options: '${{ env.CMAKE_OPT }}' + + - name: "Accuracy:DNN_ORT" + timeout-minutes: 60 + if: ${{ always() && steps.build-opencv.outcome == 'success' }} + env: + OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' + OPENCV_FORCE_DNN_ENGINE: "4" + GTEST_FILTER_STRING: "*:-*conformance*" + run: | + cd ${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }} + xvfb-run -a bin/opencv_test_dnn \ + --gtest_filter="${{ env.GTEST_FILTER_STRING }}" \ + --test_threads=${{ env.OPENCV_FOR_THREADS_NUM }} \ + --skip_unstable=1 + + - if: ${{ always() && env.WARNINGS == '1' }} + name: Warnings check + run: | + echo "::error Warnings have been found!" + exit 1