Skip to content

Commit 9a62fa4

Browse files
committed
workflows: migrate build test to github action
1 parent 8430c16 commit 9a62fa4

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/build_tests.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ROS Build & Pre-commit
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-24.04
12+
container:
13+
image: quay.io/carologistics/clips_executive_base_image:kilted
14+
options: --user root
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install pre-commit
20+
run: |
21+
apt update && apt install -y pre-commit git
22+
23+
- name: Run pre-commit hooks
24+
run: |
25+
cd $GITHUB_WORKSPACE
26+
# Source the ROS environment
27+
. /opt/ros/kilted/setup.sh
28+
cd $GITHUB_WORKSPACE
29+
# Run pre-commit
30+
pre-commit run --all-files --hook-stage manual
31+
env:
32+
PRE_COMMIT_HOME: /var/cache/pre-commit
33+
34+
ros-build:
35+
runs-on: ubuntu-24.04
36+
needs: pre-commit
37+
strategy:
38+
matrix:
39+
ros_distro: [humble, jazzy, kilted]
40+
container:
41+
image: quay.io/carologistics/clips_executive_base_image:${{ matrix.ros_distro }}
42+
options: --user root
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
47+
- name: Build ROS workspace
48+
run: |
49+
set -e
50+
export ROS_DISTRO=${{ matrix.ros_distro }}
51+
echo "Building workspace for $ROS_DISTRO"
52+
. /opt/ros/$ROS_DISTRO/setup.sh
53+
cd /ros_ws
54+
colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF
55+
56+
- name: Run ROS tests
57+
run: |
58+
. /opt/ros/${{ matrix.ros_distro }}/setup.sh
59+
cd /ros_ws
60+
colcon test

.github/workflows/generate_docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Generate and Publish Docs
33
on:
44
push:
55
branches:
6-
- master # Replace with your default branch
6+
- master
77
pull_request:
88

99
jobs:

0 commit comments

Comments
 (0)