-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 2.95 KB
/
Copy pathgtest.yml
File metadata and controls
106 lines (93 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Run Test
on:
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