Skip to content

Commit

Permalink
RISC-V: added nightly builder for RVV 0.7.1 (#119)
Browse files Browse the repository at this point in the history
mshabunin authored Nov 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 24c212e commit 4edd339
Showing 1 changed file with 186 additions and 0 deletions.
186 changes: 186 additions & 0 deletions .github/workflows/OCV-Nightly-RISCV.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
name: OCV Nightly RISC-V

on:
pull_request:
branches:
- main
paths:
- '.github/workflows/OCV-Nightly-RISCV.yaml'
workflow_dispatch:
schedule:
- cron: '0 0 * * 6'

concurrency:
group: OCV-Nightly-RISCV-${{ github.ref }}
cancel-in-progress: true

env:
SRC_OPENCV: '/home/ci/opencv'
SRC_OPENCV_CONTRIB: '/home/ci/opencv_contrib'
SRC_OPENCV_EXTRA: '/home/ci/opencv_extra'
BUILD_DIR: '/home/ci/build'
CCACHE_DIR: '/home/ci/.ccache'
GIT_CACHE_DOCKER: '/home/ci/git_cache'
OPENCV_DOWNLOAD_PATH: '/home/ci/binaries_cache'
OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata'
REMOTE_HOST: 'lichee1'
REMOTE_BIN: './bin'
REMOTE_DATA: './testdata'
TEST_RUNNER: 'ssh lichee1'


jobs:
BuildAndTest:
strategy:
max-parallel: 1
matrix:
branch: ['4.x', '5.x']
runs-on: opencv-ru-lin-riscv
defaults:
run:
shell: bash
env:
BRANCH: '${{ matrix.branch }}'
container:
image: quay.io/opencv-ci/opencv-ubuntu-22.04-riscv-071:20231030
volumes:
- /mnt/cache/git_cache:/home/ci/git_cache
- /mnt/cache/ci_cache/opencv:/home/ci/.ccache
- /mnt/cache/binaries_cache:/home/ci/binaries_cache
- /home/build/.ssh:/root/.ssh
steps:
- name: Define proper HOME path
timeout-minutes: 60
run: echo "HOME=/home/ci" >> $GITHUB_ENV
- name: Fetch opencv
timeout-minutes: 60
run: |
rm -rf ${{ env.SRC_OPENCV }}
git clone \
--single-branch \
--branch ${{ env.BRANCH }} \
--reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv.git \
https://github.com/opencv/opencv.git \
${{ env.SRC_OPENCV }}
- name: Fetch opencv_contrib
timeout-minutes: 60
run: |
rm -rf ${{ env.SRC_OPENCV_CONTRIB }}
git clone \
--single-branch \
--branch ${{ env.BRANCH }} \
--reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv_contrib.git \
https://github.com/opencv/opencv_contrib.git \
${{ env.SRC_OPENCV_CONTRIB }}
- name: Fetch opencv_extra
timeout-minutes: 60
run: |
rm -rf ${{ env.SRC_OPENCV_EXTRA }}
git clone \
--single-branch \
--branch ${{ env.BRANCH }} \
--reference-if-able ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git \
https://github.com/opencv/opencv_extra.git \
${{ env.SRC_OPENCV_EXTRA }}
- name: Configure OpenCV
timeout-minutes: 60
run: |
cmake -G Ninja \
-S ${{ env.SRC_OPENCV }} \
-B ${{ env.BUILD_DIR }} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.SRC_OPENCV }}/platforms/linux/riscv64-071-gcc.toolchain.cmake \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_OPENCL=OFF \
-DOPENCV_EXTRA_MODULES_PATH=${{ env.SRC_OPENCV_CONTRIB }}/modules \
-DCMAKE_INSTALL_PREFIX=${{ env.BUILD_DIR }}/install
- name: Build OpenCV
timeout-minutes: 60
id: build
run: |
ninja -C ${{ env.BUILD_DIR }} install | tee ${{ env.BUILD_DIR }}/build-log.txt
- name: Deploy to remote host
timeout-minutes: 60
id: deploy
run: |
rsync -az --stats ${{ env.BUILD_DIR }}/bin/ ${REMOTE_HOST}:${REMOTE_BIN} --delete
rsync -az --stats ${{ env.SRC_OPENCV_EXTRA }}/testdata/ ${REMOTE_HOST}:${REMOTE_DATA} --delete
- name: Run core test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_core \
--gtest_filter=*:-Samples.findFile:hal_intrin128.*_BASELINE:*ElemWiseTest.accuracy*
- name: Run imgproc test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_imgproc \
--gtest_filter=*:-Imgproc_Hist_Compare.accuracy
- name: Run calib3d test
timeout-minutes: 60
if: ${{ always() && matrix.branch == '4.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_calib3d
- name: Run 3d test
timeout-minutes: 60
if: ${{ always() && matrix.branch == '5.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_3d
- name: Run calib test
timeout-minutes: 60
if: ${{ always() && matrix.branch == '5.x' && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_calib
- name: Run dnn test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_dnn
- name: Run features2d test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_features2d
- name: Run objdetect test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_objdetect
- name: Run photo test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_photo
- name: Run stitching test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_stitching
- name: Run video test
timeout-minutes: 60
if: ${{ always() && steps.build.outcome == 'success' && steps.deploy.outcome == 'success' }}
run: |
$TEST_RUNNER \
OPENCV_TEST_DATA_PATH=${REMOTE_DATA} \
${REMOTE_BIN}/opencv_test_video \
--gtest_filter=*:-Video_RunningAvg.accuracy

0 comments on commit 4edd339

Please sign in to comment.