Skip to content

OCV Nightly:docs-js #881

OCV Nightly:docs-js

OCV Nightly:docs-js #881

name: OCV Nightly:docs-js
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/OCV-Nightly-docs-js.yaml'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
concurrency:
group: OCV-Nightly-docs-js-${{ github.ref }}
cancel-in-progress: true
env:
EXTRA_CMAKE_OPTIONS: '-DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DBUILD_TESTS=ON -DWITH_OPENNI2=ON -DWITH_GDCM=ON -DOPENCV_JS_LOCATION=/home/ci/build/js/bin/opencv.js -DWITH_GDAL=ON -DBUILD_EXAMPLES=ON -DBUILD_DOCS=ON -DBUILD_PERF_TESTS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_EXTRA_MODULES_PATH=/home/ci/opencv_contrib/modules'
OPENCV_DOCKER_WORKDIR: '/home/ci/opencv'
jobs:
BuildAndTest:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
branch: ['3.4', '4.x', '5.x']
container:
image: quay.io/opencv-ci/opencv-docs-js-20.04:20220728
options: --user ci
steps:
- name: Define proper HOME path
timeout-minutes: 60
run: echo "HOME=/home/ci" >> $GITHUB_ENV
- name: Clean
timeout-minutes: 60
run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete
- name: Fetch opencv
timeout-minutes: 60
run: git clone --branch ${{ matrix.branch }} https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }}
- name: Clone opencv_contrib
timeout-minutes: 60
run: git clone --single-branch --branch ${{ matrix.branch }} https://github.com/opencv/opencv_contrib.git $HOME/opencv_contrib
- name: Build js
timeout-minutes: 60
run: |
cd $HOME/build
emcmake python ../opencv/platforms/js/build_js.py js --build_test
- name: Run js tests
timeout-minutes: 60
if: ${{ always() && matrix.branch == '4.x' }}
run: |
cd $HOME/build/js/bin
npm install
node tests.js
- name: Configure OpenCV doxygen
timeout-minutes: 60
run: |
cd $HOME/build
cmake ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }}
- name: Build OpenCV doxygen
timeout-minutes: 60
id: build-opencv
run: |
cd $HOME/build
cmake --build . --config release --target doxygen -- -j$(nproc)
- name: Pack docs
timeout-minutes: 60
if: ${{ always() && steps.build-opencv.outcome == 'success' }}
run: |
cd $HOME/build
python $HOME/scripts/pack_docs.py doc release
- name: Upload arftifacts
timeout-minutes: 60
if: ${{ (always() && steps.build-opencv.outcome == 'success') && github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || env.RUNNER_DEBUG == 1 }}
uses: actions/upload-artifact@v3
with:
name: OpenCVDocDoxygen${{ matrix.branch }}
path: /home/ci/build/release/doc_doxygen.zip