diff --git a/.github/workflows/PR-3.4-U20.yaml b/.github/workflows/PR-3.4-U20.yaml index 2446a07478..e400962379 100644 --- a/.github/workflows/PR-3.4-U20.yaml +++ b/.github/workflows/PR-3.4-U20.yaml @@ -6,24 +6,29 @@ on: - 3.4 env: - EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DENABLE_CCACHE=OFF' - OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' - OPENCV_DOCKER_WORKDIR: '/__w/opencv/opencv' + 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' + ANT_HOME: /usr/share/ant + GIT_CACHE_DOCKER: /home/ci/git_cache PYTHONPATH: /opencv-build/python_loader:$PYTHONPATH + OPENCV_TEST_DATA_PATH: /opencv_extra/testdata + OPENCV_DOCKER_WORKDIR: /opencv jobs: BuildAndTest: - runs-on: ubuntu-20.04 + runs-on: opencv-cn-lin-x86-64 defaults: run: shell: bash container: image: quay.io/asenyaev/opencv-ubuntu:20.04 + 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: PR info run: | @@ -31,13 +36,9 @@ jobs: echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean - run: find . -mindepth 1 -delete + run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - name: Fetch opencv - uses: actions/checkout@v3 - with: - repository: opencv/opencv - ref: ${{ env.TARGET_BRANCH_NAME }} - fetch-depth: 0 + 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 run: | cd ${{ env.OPENCV_DOCKER_WORKDIR }} @@ -46,7 +47,7 @@ jobs: git config user.name "opencv.ci" git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - name: Clone opencv_extra - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} https://github.com/opencv/opencv_extra.git /opencv_extra + 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 /opencv_extra - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch run: | OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true @@ -141,12 +142,16 @@ jobs: run: cd /opencv-build && cmake --build . --config release --target check_pylint -- -j4 BuildContrib: - runs-on: ubuntu-20.04 + runs-on: opencv-cn-lin-x86-64 defaults: run: shell: bash container: image: quay.io/asenyaev/opencv-ubuntu:20.04 + 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: PR info run: | @@ -154,13 +159,9 @@ jobs: echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean - run: find . -mindepth 1 -delete + run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - name: Fetch opencv - uses: actions/checkout@v3 - with: - repository: opencv/opencv - ref: ${{ env.TARGET_BRANCH_NAME }} - fetch-depth: 0 + 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 run: | cd ${{ env.OPENCV_DOCKER_WORKDIR }}