|
| 1 | +name: OCV Nightly RISC-V |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - '.github/workflows/OCV-Nightly-RISCV.yaml' |
| 9 | + workflow_dispatch: |
| 10 | + schedule: |
| 11 | + - cron: '0 0 * * 6' |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: OCV-Nightly-RISCV-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +env: |
| 18 | + SRC_OPENCV: '/home/ci/opencv' |
| 19 | + SRC_OPENCV_CONTRIB: '/home/ci/opencv_contrib' |
| 20 | + SRC_OPENCV_EXTRA: '/home/ci/opencv_extra' |
| 21 | + BUILD_DIR: '/home/ci/build' |
| 22 | + CCACHE_DIR: '/home/ci/.ccache' |
| 23 | + GIT_CACHE_DOCKER: '/home/ci/git_cache' |
| 24 | + OPENCV_DOWNLOAD_PATH: '/home/ci/binaries_cache' |
| 25 | + OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata' |
| 26 | + REMOTE_HOST: 'lichee1' |
| 27 | + REMOTE_BIN: './bin' |
| 28 | + REMOTE_DATA: './testdata' |
| 29 | + TEST_RUNNER: 'ssh lichee1' |
| 30 | + |
| 31 | + |
| 32 | +jobs: |
| 33 | + BuildAndTest: |
| 34 | + strategy: |
| 35 | + max-parallel: 1 |
| 36 | + matrix: |
| 37 | + branch: ['4.x', '5.x'] |
| 38 | + runs-on: opencv-ru-lin-riscv |
| 39 | + defaults: |
| 40 | + run: |
| 41 | + shell: bash |
| 42 | + env: |
| 43 | + BRANCH: '${{ matrix.branch }}' |
| 44 | + container: |
| 45 | + image: quay.io/opencv-ci/opencv-ubuntu-22.04-riscv-071:20231030 |
| 46 | + volumes: |
| 47 | + - /mnt/cache/git_cache:/home/ci/git_cache |
| 48 | + - /mnt/cache/ci_cache/opencv:/home/ci/.ccache |
| 49 | + - /mnt/cache/binaries_cache:/home/ci/binaries_cache |
| 50 | + - /home/build/.ssh:/root/.ssh |
| 51 | + steps: |
| 52 | + - name: Define proper HOME path |
| 53 | + timeout-minutes: 60 |
| 54 | + run: echo "HOME=/home/ci" >> $GITHUB_ENV |
| 55 | + - name: Fetch opencv |
| 56 | + timeout-minutes: 60 |
| 57 | + run: | |
| 58 | + rm -rf ${{ env.SRC_OPENCV }} |
| 59 | + git clone \ |
| 60 | + --single-branch \ |
| 61 | + --branch ${{ env.BRANCH }} \ |
| 62 | + --reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv.git \ |
| 63 | + https://github.com/opencv/opencv.git \ |
| 64 | + ${{ env.SRC_OPENCV }} |
| 65 | + - name: Fetch opencv_contrib |
| 66 | + timeout-minutes: 60 |
| 67 | + run: | |
| 68 | + rm -rf ${{ env.SRC_OPENCV_CONTRIB }} |
| 69 | + git clone \ |
| 70 | + --single-branch \ |
| 71 | + --branch ${{ env.BRANCH }} \ |
| 72 | + --reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv_contrib.git \ |
| 73 | + https://github.com/opencv/opencv_contrib.git \ |
| 74 | + ${{ env.SRC_OPENCV_CONTRIB }} |
| 75 | + - name: Fetch opencv_extra |
| 76 | + timeout-minutes: 60 |
| 77 | + run: | |
| 78 | + rm -rf ${{ env.SRC_OPENCV_EXTRA }} |
| 79 | + git clone \ |
| 80 | + --single-branch \ |
| 81 | + --branch ${{ env.BRANCH }} \ |
| 82 | + --reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git \ |
| 83 | + https://github.com/opencv/opencv_extra.git \ |
| 84 | + ${{ env.SRC_OPENCV_EXTRA }} |
| 85 | + - name: Configure OpenCV |
| 86 | + timeout-minutes: 60 |
| 87 | + run: | |
| 88 | + cmake -G Ninja \ |
| 89 | + -S ${{ env.SRC_OPENCV }} \ |
| 90 | + -B ${{ env.BUILD_DIR }} \ |
| 91 | + -DCMAKE_TOOLCHAIN_FILE=${{ env.SRC_OPENCV }}/platforms/linux/riscv64-071-gcc.toolchain.cmake \ |
| 92 | + -DBUILD_SHARED_LIBS=OFF \ |
| 93 | + -DWITH_OPENCL=OFF \ |
| 94 | + -DOPENCV_EXTRA_MODULES_PATH=${{ env.SRC_OPENCV_CONTRIB }}/modules \ |
| 95 | + -DCMAKE_INSTALL_PREFIX=${{ env.BUILD_DIR }}/install |
| 96 | + - name: Build OpenCV |
| 97 | + timeout-minutes: 60 |
| 98 | + id: build |
| 99 | + run: | |
| 100 | + ninja -C ${{ env.BUILD_DIR }} install | tee ${{ env.BUILD_DIR }}/build-log.txt |
| 101 | + - name: Deploy to remote host |
| 102 | + timeout-minutes: 60 |
| 103 | + id: deploy |
| 104 | + run: | |
| 105 | + rsync -az --stats ${{ env.BUILD_DIR }}/bin/ ${REMOTE_HOST}:${REMOTE_BIN} --delete |
| 106 | + rsync -az --stats ${{ env.SRC_OPENCV_EXTRA }}/testdata/ ${REMOTE_HOST}:${REMOTE_DATA} --delete |
| 107 | + - name: Run core test |
| 108 | + timeout-minutes: 60 |
| 109 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 110 | + run: | |
| 111 | + $TEST_RUNNER \ |
| 112 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 113 | + ${REMOTE_BIN}/opencv_test_core \ |
| 114 | + --gtest_filter=*:-Samples.findFile:hal_intrin128.*_BASELINE:*ElemWiseTest.accuracy* |
| 115 | + - name: Run imgproc test |
| 116 | + timeout-minutes: 60 |
| 117 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 118 | + run: | |
| 119 | + $TEST_RUNNER \ |
| 120 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 121 | + ${REMOTE_BIN}/opencv_test_imgproc \ |
| 122 | + --gtest_filter=*:-Imgproc_Hist_Compare.accuracy |
| 123 | + - name: Run calib3d test |
| 124 | + timeout-minutes: 60 |
| 125 | + if: ${{ always() && matrix.branch == '4.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 126 | + run: | |
| 127 | + $TEST_RUNNER \ |
| 128 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 129 | + ${REMOTE_BIN}/opencv_test_calib3d |
| 130 | + - name: Run 3d test |
| 131 | + timeout-minutes: 60 |
| 132 | + if: ${{ always() && matrix.branch == '5.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 133 | + run: | |
| 134 | + $TEST_RUNNER \ |
| 135 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 136 | + ${REMOTE_BIN}/opencv_test_3d |
| 137 | + - name: Run calib test |
| 138 | + timeout-minutes: 60 |
| 139 | + if: ${{ always() && matrix.branch == '5.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 140 | + run: | |
| 141 | + $TEST_RUNNER \ |
| 142 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 143 | + ${REMOTE_BIN}/opencv_test_calib |
| 144 | + - name: Run dnn test |
| 145 | + timeout-minutes: 60 |
| 146 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 147 | + run: | |
| 148 | + $TEST_RUNNER \ |
| 149 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 150 | + ${REMOTE_BIN}/opencv_test_dnn |
| 151 | + - name: Run features2d test |
| 152 | + timeout-minutes: 60 |
| 153 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 154 | + run: | |
| 155 | + $TEST_RUNNER \ |
| 156 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 157 | + ${REMOTE_BIN}/opencv_test_features2d |
| 158 | + - name: Run objdetect test |
| 159 | + timeout-minutes: 60 |
| 160 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 161 | + run: | |
| 162 | + $TEST_RUNNER \ |
| 163 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 164 | + ${REMOTE_BIN}/opencv_test_objdetect |
| 165 | + - name: Run photo test |
| 166 | + timeout-minutes: 60 |
| 167 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 168 | + run: | |
| 169 | + $TEST_RUNNER \ |
| 170 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 171 | + ${REMOTE_BIN}/opencv_test_photo |
| 172 | + - name: Run stitching test |
| 173 | + timeout-minutes: 60 |
| 174 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 175 | + run: | |
| 176 | + $TEST_RUNNER \ |
| 177 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 178 | + ${REMOTE_BIN}/opencv_test_stitching |
| 179 | + - name: Run video test |
| 180 | + timeout-minutes: 60 |
| 181 | + if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }} |
| 182 | + run: | |
| 183 | + $TEST_RUNNER \ |
| 184 | + OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \ |
| 185 | + ${REMOTE_BIN}/opencv_test_video \ |
| 186 | + --gtest_filter=*:-Video_RunningAvg.accuracy |
0 commit comments