End-to-End Depthai-nodes tests #4
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: End-to-End Depthai-nodes tests | |
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' | |
branch: | |
description: 'Branch to run the tests on. Default: main' | |
required: true | |
default: 'main' | |
testbed: | |
description: 'Testbed to run the tests on. Default: oak4-pro' | |
required: true | |
default: 'oak4-pro' | |
jobs: | |
HIL-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.12] | |
steps: | |
- name: Setup WireGuard | |
run: | | |
sudo apt install wireguard | |
echo "${{ secrets.WIREGUARD_PRIVATE_KEY }}" > privatekey | |
sudo ip link add dev wg0 type wireguard | |
sudo ip address add dev wg0 10.12.99.26 peer 10.12.99.1 | |
sudo wg set wg0 listen-port 48123 private-key privatekey peer ${{ secrets.WIREGUARD_PUBLIC_KEY }} allowed-ips 10.12.99.1/32,10.12.99.26/32,10.12.0.0/16 endpoint "${{ secrets.WIREGUARD_PUBLIC_ENDPOINT }}" | |
sudo ip link set up dev wg0 | |
sudo ip route add 10.12.0.0/16 dev wg0 | |
- name: Clone HIL Framework | |
run: | | |
git clone https://oauth2:${{secrets.GITLAB_TOKEN}}@gitlab.luxonis.com/luxonis/hil_lab/hil_framework.git --recursive | |
- name: Setup HIL Tools | |
run: | | |
cd hil_framework | |
sudo chmod +x setup_hil_tools.sh | |
./setup_hil_tools.sh -ga | |
- name: Add HIL Tools to Path | |
run: | | |
cd 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: | | |
CMD="hil --testbed ${{ github.event.inputs.testbed }} --reservation-name 'depthai_nodes_ml_team' --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.event.inputs.branch }}' 'source venv/bin/activate' 'cd tests/end_to_end' 'source <(python setup_camera_ips.py)' 'export HUBAI_TEAM_ID=${{ secrets.HUBAI_TEAM_ID }}' 'export HUBAI_API_KEY=${{ secrets.HUBAI_API_KEY }}' 'python main.py ${{ github.event.inputs.additional-parameter }}' 'deactivate'" | |
eval $CMD | |
- name: Stop WireGuard | |
if: always() | |
run: | | |
sudo ip link set down dev wg0 | |
sudo ip link delete dev wg0 |