refactor: robot model and tracker #295
Workflow file for this run
This file contains hidden or 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: Run Test | |
| on: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'tool/**' | |
| - 'CMakeLists.txt' | |
| - 'package.xml' | |
| - '.github/workflows/gtest.yml' | |
| pull_request: | |
| paths: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'tool/**' | |
| - 'CMakeLists.txt' | |
| - 'package.xml' | |
| - '.github/workflows/gtest.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RMCS_REPO: https://github.com/Alliance-Algorithm/RMCS.git | |
| RMCS_REF: main | |
| HIKCAMERA_REPO: https://github.com/Alliance-Algorithm/ros2-hikcamera.git | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: qzhhhi/rmcs-develop | |
| options: --user 0 | |
| env: | |
| TEST_ASSETS_ROOT: /tmp/auto_aim | |
| steps: | |
| - name: Checkout rmcs_auto_aim_v2 | |
| uses: actions/checkout@v4 | |
| with: | |
| path: rmcs_auto_aim_v2 | |
| - name: Clone RMCS workspace | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git clone --depth 1 --recurse-submodules --branch "${RMCS_REF}" "${RMCS_REPO}" /tmp/RMCS | |
| git clone --depth 1 "${HIKCAMERA_REPO}" /tmp/RMCS/rmcs_ws/src/hikcamera | |
| mkdir -p /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2 | |
| tar -C "${GITHUB_WORKSPACE}/rmcs_auto_aim_v2" --exclude=".git" -cf - . \ | |
| | tar -C /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2 -xf - | |
| - name: Install yq dependency | |
| run: | | |
| apt-get update | |
| apt-get install -y yq | |
| - name: Build RMCS workspace | |
| shell: bash | |
| working-directory: /tmp/RMCS/rmcs_ws | |
| run: | | |
| set -euo pipefail | |
| set +u | |
| source /opt/ros/jazzy/setup.bash | |
| set -u | |
| colcon build --packages-up-to rmcs_auto_aim_v2 | |
| - name: Download test assets | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| set +u | |
| source /opt/ros/jazzy/setup.bash | |
| source /tmp/RMCS/rmcs_ws/install/setup.bash | |
| set -u | |
| cd /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2/test | |
| TEST_ASSETS_ROOT="$TEST_ASSETS_ROOT" ./download_assets.sh | |
| - name: Configure test project | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| set +u | |
| source /opt/ros/jazzy/setup.bash | |
| source /tmp/RMCS/rmcs_ws/install/setup.bash | |
| set -u | |
| cd /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2/test | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build test project | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| set +u | |
| source /opt/ros/jazzy/setup.bash | |
| source /tmp/RMCS/rmcs_ws/install/setup.bash | |
| set -u | |
| cd /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2/test | |
| cmake --build build --parallel | |
| - name: Run gtests | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| set +u | |
| source /opt/ros/jazzy/setup.bash | |
| source /tmp/RMCS/rmcs_ws/install/setup.bash | |
| set -u | |
| cd /tmp/RMCS/rmcs_ws/src/rmcs_auto_aim_v2/test | |
| ctest --test-dir build --output-on-failure |