Skip to content

Commit dfbc876

Browse files
authored
ROS & Optimized CMake Workflows (#22)
* added ROS workflows * renamed to simpler ros2 * added manual workflow triggering on any branch * started testing * added set -u workaround * added tests * better names * upgraded action versions * reverted to 0.7 * try fixing permission problem of artifacts * better fix for permission issues * removed src folder as we dont need it in the tests * updated other workflows * added main branch to ros and ubu * added main branch to macos runner * added dependencies to package xml that match the plain cmake version * rmagine not found in tests * added src folder with the hope that colcon test is finding rmagine then
1 parent cced2f2 commit dfbc876

17 files changed

Lines changed: 420 additions & 325 deletions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: cmake_macos_14
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- 'main'
10+
workflow_dispatch:
11+
branches:
12+
- '*'
13+
14+
jobs:
15+
macos-14:
16+
name: macos-14
17+
uses: ./.github/workflows/cmake_macos_template.yml
18+
with:
19+
os: macos-14
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: cmake_macos_15
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- 'main'
10+
workflow_dispatch:
11+
branches:
12+
- '*'
13+
14+
jobs:
15+
macos-15:
16+
name: macos-15
17+
uses: ./.github/workflows/cmake_macos_template.yml
18+
with:
19+
os: macos-15
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: cmake_macos_reusable
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
cmake-build:
12+
name: build
13+
runs-on: ${{ inputs.os }}
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
path: rmagine
20+
21+
- name: Install dependencies
22+
run: |
23+
brew update
24+
brew install tbb boost eigen assimp jsoncpp cmake
25+
echo 'MACOSX_DEPLOYMENT_TARGET=13.0' >> "$GITHUB_ENV"
26+
27+
- name: Configure
28+
run: |
29+
set -euxo pipefail
30+
mkdir -p rmagine/build
31+
cd rmagine/build
32+
cmake \
33+
-DCMAKE_OSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \
34+
-DCMAKE_PREFIX_PATH="$(brew --prefix)" \
35+
-DRMAGINE_CUDA_DISABLE=ON \
36+
-DRMAGINE_OPTIX_DISABLE=ON \
37+
..
38+
39+
- name: Build
40+
run: make -j"$(sysctl -n hw.logicalcpu)" -C rmagine/build
41+
42+
- name: Archive build directory
43+
run: tar czf /tmp/cmake-macos-build.tar.gz -C rmagine build
44+
45+
- name: Upload build artifacts
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: cmake-macos-build
49+
path: /tmp/cmake-macos-build.tar.gz
50+
51+
cmake-test:
52+
name: tests
53+
runs-on: ${{ inputs.os }}
54+
needs: cmake-build
55+
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
with:
60+
path: rmagine
61+
62+
- name: Install dependencies
63+
run: |
64+
brew update
65+
brew install tbb boost eigen assimp jsoncpp cmake
66+
echo 'MACOSX_DEPLOYMENT_TARGET=13.0' >> "$GITHUB_ENV"
67+
68+
- name: Download build artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: cmake-macos-build
72+
path: /tmp
73+
74+
- name: Extract build directory
75+
run: tar xzf /tmp/cmake-macos-build.tar.gz -C rmagine
76+
77+
- name: Run tests
78+
run: |
79+
cd rmagine/build
80+
./bin/rmagine_version
81+
ctest --output-on-failure
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: cmake_ubuntu_22
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- 'main'
10+
workflow_dispatch:
11+
branches:
12+
- '*'
13+
14+
jobs:
15+
ubuntu-22:
16+
name: ubuntu-22
17+
uses: ./.github/workflows/cmake_ubuntu_template.yml
18+
with:
19+
os: ubuntu-22.04
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: cmake_ubuntu_24
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- 'main'
10+
workflow_dispatch:
11+
branches:
12+
- '*'
13+
14+
jobs:
15+
ubuntu-24:
16+
name: ubuntu-24
17+
uses: ./.github/workflows/cmake_ubuntu_template.yml
18+
with:
19+
os: ubuntu-24.04
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: cmake_ubuntu_reusable
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
cmake-build:
12+
name: build
13+
runs-on: ${{ inputs.os }}
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
path: rmagine
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y \
25+
libtbb-dev \
26+
libboost-dev \
27+
libeigen3-dev \
28+
libassimp-dev \
29+
libjsoncpp-dev \
30+
cmake
31+
32+
- name: Configure
33+
run: |
34+
set -euxo pipefail
35+
mkdir -p rmagine/build
36+
cd rmagine/build
37+
cmake \
38+
-DRMAGINE_CUDA_DISABLE=ON \
39+
-DRMAGINE_OPTIX_DISABLE=ON \
40+
..
41+
42+
- name: Build
43+
run: make -j"$(nproc)" -C rmagine/build
44+
45+
- name: Archive build directory
46+
run: tar czf /tmp/cmake-ubuntu-build.tar.gz -C rmagine build
47+
48+
- name: Upload build artifacts
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: cmake-ubuntu-build
52+
path: /tmp/cmake-ubuntu-build.tar.gz
53+
54+
cmake-test:
55+
name: tests
56+
runs-on: ${{ inputs.os }}
57+
needs: cmake-build
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
with:
63+
path: rmagine
64+
65+
- name: Install dependencies
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y \
69+
libtbb-dev \
70+
libboost-dev \
71+
libeigen3-dev \
72+
libassimp-dev \
73+
libjsoncpp-dev \
74+
cmake
75+
76+
- name: Download build artifacts
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: cmake-ubuntu-build
80+
path: /tmp
81+
82+
- name: Extract build directory
83+
run: tar xzf /tmp/cmake-ubuntu-build.tar.gz -C rmagine
84+
85+
- name: Run tests
86+
run: |
87+
cd rmagine/build
88+
./bin/rmagine_version
89+
ctest --output-on-failure

.github/workflows/core_macos.yml

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

.github/workflows/core_ubuntu.yml

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

0 commit comments

Comments
 (0)