Skip to content

Commit f60ce32

Browse files
committed
port ci to gh
1 parent 71d0a75 commit f60ce32

File tree

11 files changed

+146
-33
lines changed

11 files changed

+146
-33
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build and Test (Focal-ROS1)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Build the Docker image and start the container
18+
run: docker compose up -d
19+
working-directory: ./docker/focal-ros1
20+
- name: Compile the library
21+
run: docker compose exec dev ./scripts/build.bash
22+
working-directory: ./docker/focal-ros1
23+
- name: Run tests
24+
run: docker compose exec dev ./scripts/test.bash
25+
working-directory: ./docker/focal-ros1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build and Test (Noble-ROS2)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Build the Docker image and start the container
18+
run: docker compose up -d
19+
working-directory: ./docker/noble-ros2
20+
- name: Compile the library
21+
run: docker compose exec dev ./scripts/build.bash
22+
working-directory: ./docker/noble-ros2
23+
- name: Run tests
24+
run: docker compose exec dev ./scripts/test.bash
25+
working-directory: ./docker/noble-ros2

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

docker/focal-ros1/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM hhcmhub/xbot2-focal-dev

docker/focal-ros1/compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
dev:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
volumes:
7+
- ./scripts:/home/user/scripts:ro
8+
- ../..:/home/user/test_ws/src/matlogger2:ro
9+
entrypoint: /bin/bash
10+
tty: true
11+
stdin_open: true
12+
environment:
13+
- TERM=xterm-256color
14+
- FOREST_JOBS
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# make forest https
5+
export HHCM_FOREST_CLONE_DEFAULT_PROTO=https
6+
7+
# create ws and source it
8+
mkdir -p test_ws && cd test_ws
9+
forest init
10+
11+
# setup env
12+
source /opt/ros/noetic/setup.bash
13+
source setup.bash
14+
15+
# add recipes
16+
forest add-recipes git@github.com:advrhumanoids/multidof_recipes.git -t master
17+
18+
# build
19+
export PYTHONUNBUFFERED=1
20+
forest grow pybind11 --verbose --clone-depth 1 -j ${FOREST_JOBS:-1}
21+
forest grow matlogger2 --verbose --clone-depth 1 -j ${FOREST_JOBS:-1}
22+
23+
# build tests
24+
cd build/matlogger2
25+
cmake -DBUILD_TESTS=1 .
26+
make -j ${FOREST_JOBS:-1}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd test_ws/build/matlogger2
5+
ctest --output-on-failure

docker/noble-ros2/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM hhcmhub/xbot2-noble-dev

docker/noble-ros2/compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
dev:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
volumes:
7+
- ./scripts:/home/user/scripts:ro
8+
- ../..:/home/user/test_ws/src/matlogger2:ro
9+
entrypoint: /bin/bash
10+
tty: true
11+
stdin_open: true
12+
environment:
13+
- TERM=xterm-256color
14+
- FOREST_JOBS
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# make forest https
5+
export HHCM_FOREST_CLONE_DEFAULT_PROTO=https
6+
7+
# activate python venv
8+
source env/bin/activate
9+
10+
# create ws and source it
11+
sudo chown user:user test_ws
12+
mkdir -p test_ws && cd test_ws
13+
forest init
14+
15+
# setup env
16+
source /opt/ros/jazzy/setup.bash
17+
source setup.bash
18+
19+
# add recipes
20+
forest add-recipes git@github.com:advrhumanoids/multidof_recipes.git -t ros2
21+
22+
# build
23+
export PYTHONUNBUFFERED=1
24+
# forest grow pybind11 --verbose --clone-depth 1 -j 10
25+
forest grow matlogger2 --verbose --clone-depth 1 -j ${FOREST_JOBS:-1}
26+
27+
# build tests
28+
cd build/matlogger2
29+
cmake -DBUILD_TESTS=1 .
30+
make -j ${FOREST_JOBS:-1}

0 commit comments

Comments
 (0)