-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.54 KB
/
build_test.yml
File metadata and controls
60 lines (50 loc) · 1.54 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
name: X17-Surface Build Test
# Controls when the action will run.
# Workflow runs when manually triggered using the UI, or when a push or pull request is made to the main branch
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
# Set up ROS 2 (Jazzy)
- name: Set up ROS 2
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
# Install dependencies from requirements.txt
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y python3-pip
sudo pip3 install -r requirements.txt
sudo apt-get update && sudo apt-get install -y wget
# Run the install MediaMTX script
- name: Install MediaMTX
run: |
chmod +x scripts/install_mediamtx.sh
scripts/install_mediamtx.sh
# Build the ROS workspace
- name: Build workspace
run: |
chmod +x scripts/build.sh
scripts/build.sh
# Run the build script
- name: Start and check ROS 2 nodes
run: |
chmod +x scripts/run.sh
scripts/run.sh &
sleep 15 # Give nodes time to start
# Kill ROS 2 nodes
echo "Killing ROS 2 nodes:"
pkill -f ros2 || true # Success message
- name: Success
run: echo "Success!"