OCV Nightly RISC-V #195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
jobs: | |
RISC-V: | |
runs-on: opencv-ru-lin-riscv | |
concurrency: | |
group: OCV-Nightly-RISCV-${{ matrix.remote && matrix.host || matrix.version }} | |
cancel-in-progress: false | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
version: | |
- '071' | |
- 'main' | |
- 'nds' | |
- 'sc' | |
branch: ['4.x', '5.x'] | |
include: | |
- version: '071' | |
image: '20240117' | |
remote: true | |
host: 'lichee1' | |
- version: 'main' | |
image: '20240709' | |
remote: true | |
host: 'canmv1' | |
- version: 'nds' | |
image: '20240709' | |
- version: 'sc' | |
image: '20250216' | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: 'quay.io/opencv-ci/opencv-ubuntu-22.04-riscv-${{ matrix.version }}:${{ matrix.image }}' | |
volumes: | |
- /mnt/cache/git_cache:/opt/git_cache | |
- /mnt/cache/ci_cache/opencv:/opt/.ccache | |
- /mnt/cache/binaries_cache:/opt/binaries_cache | |
- /home/build/.ssh:/root/.ssh | |
options: '--user root:root' | |
env: | |
CCACHE_DIR: '/opt/.ccache' | |
CCACHE_MAXSIZE: '3G' | |
OPENCV_DOWNLOAD_PATH: '/opt/binaries_cache' | |
CMAKE_OPT: >- | |
-DBUILD_EXAMPLES=ON | |
-DOPENCV_ENABLE_NONFREE=ON | |
-DBUILD_SHARED_LIBS=OFF | |
-DWITH_OPENCL=OFF | |
${{ matrix.version == '071' && '-DCMAKE_TOOLCHAIN_FILE=${HOME}/opencv/platforms/linux/riscv64-071-gcc.toolchain.cmake -DCORE=C910V' || '' }} | |
${{ matrix.version == 'main' && '-DCMAKE_TOOLCHAIN_FILE=${HOME}/opencv/platforms/linux/riscv64-clang.toolchain.cmake -DCPU_BASELINE=RVV -DCPU_BASELINE_REQUIRE=RVV -DRISCV_RVV_SCALABLE=ON' || '' }} | |
${{ matrix.version == 'nds' && '-DCMAKE_TOOLCHAIN_FILE=${HOME}/opencv/platforms/linux/riscv64-andes-gcc.toolchain.cmake -DRISCV_GCC_INSTALL_ROOT=/opt/andes -DWITH_NDSRVP=ON' || '' }} | |
${{ matrix.version == 'sc' && '-DCMAKE_TOOLCHAIN_FILE=${HOME}/opencv/platforms/linux/riscv64-clang.toolchain.cmake -DRISCV_CLANG_BUILD_ROOT=/opt/sc-dt/llvm -DRISCV_GCC_INSTALL_ROOT=/opt/sc-dt/riscv-gcc -DCPU_BASELINE=RVV -DCPU_BASELINE_REQUIRE=RVV -DRISCV_RVV_SCALABLE=ON' || '' }} | |
HOME: '/home/ci' | |
OPENCV_FOR_THREADS_NUM: 10 | |
CMAKE_BUILD_PARALLEL_LEVEL: 20 | |
REMOTE_HOST: ${{ matrix.host }} | |
REMOTE_BIN: './bin' | |
REMOTE_DATA: './testdata' | |
steps: | |
- name: Checkout workflow repository | |
uses: actions/checkout@v4 | |
with: | |
repository: opencv/ci-gha-workflow | |
ref: "${{ github.repository == 'opencv/ci-gha-workflow' && github.ref || 'main' }}" | |
- name: Checkout and merge OpenCV | |
uses: ./checkout-and-merge | |
with: | |
target_branch: "${{ matrix.branch }}" | |
author: '' | |
source_branch: '' | |
gitcache: '/opt/git_cache' | |
home: '${{ env.HOME }}' | |
workdir: '${{ env.HOME }}' | |
- name: Configure and build OpenCV | |
uses: ./configure-and-build | |
with: | |
workdir: '${{ env.HOME }}' | |
builddir: 'build' | |
generator: 'Ninja' | |
options: '${{ env.CMAKE_OPT }}' | |
- if: ${{ matrix.remote }} | |
name: Deploy to remote host | |
timeout-minutes: 15 | |
id: deploy | |
run: | | |
rsync -az --stats ${{ env.HOME }}/build/bin/ ${REMOTE_HOST}:${REMOTE_BIN} --delete | |
rsync -az --stats ${{ env.HOME }}/opencv_extra/testdata/ ${REMOTE_HOST}:${REMOTE_DATA} --delete | |
- name: Run OpenCV tests | |
uses: ./run-tests | |
env: | |
OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' | |
OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 | |
with: | |
workdir: '${{ matrix.remote && ''.'' || env.HOME }}' | |
builddir: '${{ matrix.remote && ''.'' || ''build'' }}' | |
logdir: '${{ env.HOME }}/build' | |
plan: "test-plan-riscv-${{ matrix.branch }}.json" | |
suite: '[ ''${{ matrix.version == ''sc'' && ''short'' || ''default'' }}'' ]' | |
filter: "[ '${{ matrix.version }}' ]" | |
options: "${{ matrix.version }}" | |
timeout: "45" | |
enable_python: "false" | |
enable_java: "false" | |
suffix: '${{ matrix.version }}_${{ matrix.branch }}' | |
# TODO: enable | |
# - if: ${{ always() && env.WARNINGS == '1' }} | |
# name: Warnings check | |
# run: | | |
# echo "::error Warnings have been found!" | |
# exit 1 |