From 50eb3e08c9ca73682019516ff9ad5c71fcd0ac64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20=C5=BD=C3=A1=C4=8Dek?= Date: Thu, 7 Nov 2024 22:08:42 +0100 Subject: [PATCH] test workflow --- .github/workflows/run_test.yml | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/run_test.yml diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml new file mode 100644 index 00000000..d5ed5a87 --- /dev/null +++ b/.github/workflows/run_test.yml @@ -0,0 +1,63 @@ +name: Gen3 Experiments Runnability Test + +on: + workflow_dispatch: + inputs: + depthai_version: + + # push: + # branches: + # - gen3 + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.12] + platform: [RVC2] #TODO: add RVC4 platform + + 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 oak4-pro --reservation-name 'dominik.zacek@luxonis.com' --commands 'cd ~/Documents/source/depthai-experiments' 'git pull' 'python3 ./gen3/gen3_script_tester.py --environment-variables DEPTHAI_PLATFORM=${{ matrix.platform }} --virtual-display --path ./gen3/neural-networks/object-detection/mobile-object-localizer" + if [ -n "${{ github.event.inputs.depthai_version }}" ]; then + CMD="$CMD --depthai-version ${{ github.event.inputs.depthai_version }}" + fi + CMD="$CMD'" + eval $CMD + #TODO: swap for hil --revision RVC4 when possible infrastructure-wise + + - name: Stop WireGuard + if: always() + run: | + sudo ip link set down dev wg0 + sudo ip link delete dev wg0