DepthAI Core HIL Testing #2116
Workflow file for this run
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: DepthAI Core HIL Testing | |
on: | |
workflow_dispatch: | |
inputs: | |
distinct_id: | |
description: 'run identifier' | |
required: false | |
testbed: | |
description: 'On what testbed will tests be run' | |
required: false | |
type: string | |
reservation_name: | |
description: 'Reservation name - usually usually unique identifier of root CI run' | |
required: false | |
type: string | |
luxonis_os: | |
description: 'Which RVC4 os version to install before starting tests' | |
required: false | |
type: string | |
hold_reservation: | |
description: 'If this is set to true testbed will stay reserved after process is done - reccomended for CI use' | |
required: false | |
type: boolean | |
depthai: | |
required: false | |
type: string | |
default: "v3_develop" | |
description: "Version for depthai" | |
push: | |
branches: | |
- v3_develop | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- v3_develop | |
# Only allow latest run on same branch to be tested, treat dispatches separately. | |
concurrency: | |
group: ${{ contains(fromJson('["pull_request", "push"]'), github.event_name) && format('ci-tests-{0}-1', github.ref) || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
id: | |
name: Workflow ID Provider | |
runs-on: ubuntu-latest | |
if: github.event_name == 'workflow_dispatch' | |
steps: | |
- name: echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo ${{ github.event.inputs.distinct_id }} | |
# Testing | |
rvc4_test_bom: | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
if: github.event_name == 'workflow_dispatch' | |
strategy: | |
matrix: | |
# os: ['windows', 'macos', 'linux'] | |
os: ['linux'] | |
arch: ['x64'] | |
flavor: ['vanilla'] | |
fail-fast: false | |
runs-on: ['self-hosted', 'testbed-runner'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout source code from tag | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.depthai }} # Use input tag or the tag that triggered the workflow | |
path: depthai-core | |
submodules: 'recursive' | |
- name: Prepare HIL Framework | |
run: source scripts/hil/prepare_hil_framework.sh | |
- name: Configure, Build and Test | |
if: matrix.os == 'linux' | |
run: | | |
rm -rf depthai-core/scripts/hil/ && mkdir -p depthai-core/scripts/hil/ && cp -r scripts/hil/* depthai-core/scripts/hil/ | |
rm depthai-core/tests/run_tests.py && cp tests/run_tests.py depthai-core/tests/run_tests.py | |
cd depthai-core | |
export RESERVATION_NAME="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID#rvc4-${{ matrix.os }}-${{ matrix.flavor }}" | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
# Assign testbed and reservation name only if both are provided | |
if [[ -n "${{ github.event.inputs.testbed }}" && -n "${{ github.event.inputs.reservation_name }}" ]]; then | |
TESTBED_OPTION="--testbed ${{ github.event.inputs.testbed }}" | |
RESERVATION_OPTION="--reservation-name ${{ github.event.inputs.reservation_name }}" | |
else | |
TESTBED_OPTION="--capabilities 'depthai-core-hil' --models oak4_pro" | |
RESERVATION_OPTION="--reservation-name $RESERVATION_NAME" | |
fi | |
fi | |
if [[ "${{ github.event.inputs.hold_reservation }}" == 'true' ]]; then | |
HOLD_RESERVATION="--hold-reservation" | |
fi | |
if [[ -n "${{ github.event.inputs.luxonis_os }}" ]]; then | |
UPDATE_LUXONIS_OS="--rvc4-os-version ${{ github.event.inputs.luxonis_os }}" | |
fi | |
exec hil $HOLD_RESERVATION $TESTBED_OPTION $RESERVATION_OPTION $UPDATE_LUXONIS_OS --wait --sync-workspace --commands 'cd /tmp/depthai-core|| exit' 'scripts/hil/run_hil_tests.sh ${{ matrix.flavor }} --rvc4' | |
# Testing | |
linux_rvc2_test: | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
if: github.event_name != 'workflow_dispatch' | |
strategy: | |
matrix: | |
arch: ['x64'] | |
flavor: ['vanilla', 'asan-ubsan', 'tsan'] | |
fail-fast: false | |
runs-on: ['self-hosted', 'testbed-runner'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Prepare HIL Framework | |
run: source scripts/hil/prepare_hil_framework.sh | |
- name: Configure, Build and Test | |
run: | | |
export RESERVATION_NAME="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID#rvc2-${{ matrix.flavor }}" | |
exec hil --capabilities depthai-core-hil --platforms rvc2 --reservation-name $RESERVATION_NAME --wait --sync-workspace --commands 'cd /tmp/depthai-core|| exit' 'scripts/hil/run_hil_tests.sh ${{ matrix.flavor }} --rvc2' | |
- name: Configure, Build and Test | |
run: | | |
export RESERVATION_NAME="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID#rvc2-${{ matrix.flavor }}" | |
exec hil --capabilities depthai-core-hil --platforms rvc2 --reservation-name $RESERVATION_NAME --wait --sync-workspace --commands 'cd /tmp/depthai-core|| exit' 'scripts/hil/run_hil_tests.sh ${{ matrix.flavor }} --rvc2' | |
# Testing | |
linux_rvc4_test: | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
if: github.event_name != 'workflow_dispatch' | |
strategy: | |
matrix: | |
os: ['linux'] | |
arch: ['x64'] | |
flavor: ['vanilla', 'asan-ubsan', 'tsan'] | |
rvc4os: ['r851.1.2'] | |
fail-fast: false | |
runs-on: ['self-hosted', 'testbed-runner'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Prepare HIL Framework | |
run: source scripts/hil/prepare_hil_framework.sh | |
- name: Configure, Build and Test | |
if: matrix.os != 'linux' | |
run: | | |
export RESERVATION_NAME="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID#rvc4-${{ matrix.os }}-${{ matrix.rvc4os }}-${{ matrix.flavor }}" | |
exec hil --models oak4_pro --reservation-name $RESERVATION_NAME --wait --sync-workspace --commands 'cd /tmp/depthai-core|| exit' 'scripts/hil/run_hil_tests.sh ${{ matrix.flavor }} --rvc4 ' | |
- name: Configure, Build and Test | |
if: matrix.os == 'linux' | |
run: | | |
export RESERVATION_NAME="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID#rvc4-${{ matrix.os }}-${{ matrix.rvc4os }}-${{ matrix.flavor }}" | |
exec hil --models oak4_pro --reservation-name $RESERVATION_NAME --wait --sync-workspace --rvc4-os-version ${{ matrix.rvc4os }} --commands 'cd /tmp/depthai-core|| exit' 'scripts/hil/run_hil_tests.sh ${{ matrix.flavor }} --rvc4' | |
windows_rvc2_rvc4_test: | |
runs-on: ['self-hosted', 'windows'] | |
if: github.event_name != 'workflow_dispatch' | |
env: | |
LOCALAPPDATA: "C:/actions-runner/vcpkg_cache" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Configure, Build and Test | |
run: | | |
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D'DEPTHAI_BUILD_EXAMPLES=ON' -D'DEPTHAI_BUILD_PYTHON=ON' -D'DEPTHAI_BUILD_TESTS=ON' -DDEPTHAI_PYTHON_ENABLE_TESTS=ON -DDEPTHAI_TEST_EXAMPLES=ON -DDEPTHAI_PYTHON_TEST_EXAMPLES=ON -DDEPTHAI_PYTHON_ENABLE_EXAMPLES=ON | |
cmake --build build --parallel 4 --config Release | |
cd tests | |
python run_tests.py |