Tests: Docker support. #45
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: Integration tests for parsers. | |
on: | |
workflow_dispatch: | |
inputs: | |
additional-parameter: | |
description: 'Additional parameter: -all or -p <parser_name>. Default: -all. If -p is used: -p <parser_name>' | |
required: true | |
default: '-all --download' | |
branch: | |
description: 'Branch to run the tests on. Default: main' | |
required: true | |
default: 'main' | |
testbed: | |
description: 'Testbed to run the tests on. Available: oak4-pro, oak4-s' | |
required: true | |
default: 'oak4-s' | |
depthai-version: | |
description: 'Version of depthai to install. Default: alpha11' | |
required: true | |
default: '3.0.0a11' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'depthai_nodes/**' | |
- 'tests/integration_tests/**' | |
- .github/workflows/integration_tests.yaml | |
jobs: | |
Integration-test: | |
runs-on: ['self-hosted', 'testbed-runner'] | |
strategy: | |
matrix: | |
python-version: [3.12] | |
steps: | |
- name: Update HIL | |
run: | | |
cd /home/$USER/hil_framework | |
git pull | |
git submodule update --init --recursive | |
- name: Add HIL Tools to Path | |
run: | | |
cd /home/$USER/hil_framework | |
echo "$(pwd)/lib_testbed/tools" >> $GITHUB_PATH | |
echo "PYTHONPATH="$PYTHONPATH:$(pwd)"" >> $GITHUB_ENV | |
echo "HIL_FRAMEWORK_PATH="$(pwd)"" >> $GITHUB_ENV | |
# - name: Run Test | |
# run: | | |
# export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#${{ matrix.python-version}}" | |
# if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
# hil --testbed ${{ github.event.inputs.testbed }} --wait --reservation-name $RESERVATION_NAME --commands "cd /home/hil/depthai-nodes" "git checkout main" "git pull" "git checkout ${{ github.event.inputs.branch }}" "git pull" "source venv/bin/activate" "pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==${{ github.event.inputs.depthai-version }}" "cd tests/integration_tests" "export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}" "export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}" "python main.py ${{ github.event.inputs.additional-parameter }}" "deactivate" | |
# else | |
# hil --testbed-list oak4-s oak4-pro --wait --reservation-name $RESERVATION_NAME --commands "cd /home/hil/depthai-nodes" "git checkout main" "git pull" "git checkout ${{ github.head_ref }}" "git pull" "source venv/bin/activate" "pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==3.0.0a11" "cd tests/integration_tests" "export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}" "export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}" "python main.py -all --download" "deactivate" | |
# fi | |
- name: Run Test | |
run: | | |
export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#${{ matrix.python-version}}" | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
hil --capabilities "depthai-core-hil" --wait --reservation-name $RESERVATION_NAME --before-docker-pull "echo ${{secrets.GHCR_PAT}} | docker login ghcr.io -u ${{secrets.GHCR_USER}} --password-stdin" --docker-image ghcr.io/luxonis/depthai-nodes-integration-testing --docker-run-args "--env LUXONIS_EXTRA_INDEX_URL=${{secrets.LUXONIS_EXTRA_INDEX_URL}} --env DEPTHAI_VERSION=${{ github.event.inputs.depthai-version }} --env B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }} --env B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }} --env BRANCH=${{ github.event.inputs.branch }} --env FLAGS=\"${{ github.event.inputs.additional-parameter }}\"" | |
else | |
hil --capabilities "depthai-core-hil" --wait --reservation-name $RESERVATION_NAME --before-docker-pull "echo ${{secrets.GHCR_PAT}} | docker login ghcr.io -u ${{secrets.GHCR_USER}} --password-stdin" --docker-image ghcr.io/luxonis/depthai-nodes-integration-testing --docker-run-args "--env LUXONIS_EXTRA_INDEX_URL=${{secrets.LUXONIS_EXTRA_INDEX_URL}} --env DEPTHAI_VERSION=${{ github.event.inputs.depthai-version }} --env B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }} --env B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }} --env BRANCH=${{ github.head_ref }} --env FLAGS=\"-all --download\"" | |
fi |