-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #310 from christian-rauch/ci_cmake_all
cmake CI
- Loading branch information
Showing
20 changed files
with
158 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | ||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | ||
name: CMake on multiple platforms | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | ||
fail-fast: false | ||
|
||
# Set up a matrix to run the following 3 configurations: | ||
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator> | ||
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator> | ||
# | ||
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
build_type: [Release] | ||
c_compiler: [gcc, clang, cl] | ||
include: | ||
- os: windows-latest | ||
c_compiler: cl | ||
cpp_compiler: cl | ||
- os: windows-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: windows-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: ubuntu-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: ubuntu-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
exclude: | ||
- os: ubuntu-latest | ||
c_compiler: cl | ||
- os: macos-latest | ||
c_compiler: cl | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- uses: seanmiddleditch/gha-setup-ninja@master | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-G Ninja | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-S ${{ github.workspace }} | ||
- name: Build | ||
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | ||
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | ||
|
||
- name: Test | ||
working-directory: ${{ steps.strings.outputs.build-output-dir }} | ||
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest --build-config ${{ matrix.build_type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
name: ROS workspace CI | ||
name: colcon workspace | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
# build on Ubuntu docker images | ||
build_linux: | ||
name: Ubuntu (${{ matrix.ros_distribution }}, ${{ matrix.config }}) | ||
name: "Ubuntu (${{ matrix.ros_distribution }}, shared: ${{ matrix.cmake_shared_libs }})" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ros_distribution: [noetic, humble] | ||
config: ["default"] # nice name | ||
cmake_args: ['[ ]'] # empty list of options | ||
cmake_shared_libs: ['ON', 'OFF'] | ||
include: | ||
- docker_image: ubuntu:20.04 | ||
ros_distribution: noetic | ||
|
@@ -23,13 +22,6 @@ jobs: | |
ros_distribution: humble | ||
ros_version: 2 | ||
|
||
# build static library, this will set BUILD_PYTHON_WRAPPER to OFF | ||
- docker_image: ubuntu:22.04 | ||
ros_distribution: humble | ||
ros_version: 2 | ||
config: "static" | ||
cmake_args: '[ "-DBUILD_SHARED_LIBS=OFF" ]' | ||
|
||
container: | ||
image: ${{ matrix.docker_image }} | ||
|
||
|
@@ -40,8 +32,6 @@ jobs: | |
apt install --no-install-recommends -y git ca-certificates | ||
- uses: actions/checkout@v4 | ||
#with: | ||
# submodules: recursive | ||
|
||
- name: Setup ROS environment | ||
uses: ros-tooling/[email protected] | ||
|
@@ -52,30 +42,27 @@ jobs: | |
with: | ||
package-name: apriltag | ||
target-ros1-distro: ${{ matrix.ros_distribution }} | ||
extra-cmake-args: "-DBUILD_SHARED_LIBS=${{ matrix.cmake_shared_libs }}" | ||
|
||
- name: ROS 2 CI Action | ||
if: ${{ matrix.ros_version == 2 }} | ||
uses: ros-tooling/[email protected] | ||
with: | ||
package-name: apriltag | ||
target-ros2-distro: ${{ matrix.ros_distribution }} | ||
colcon-defaults: | | ||
{ | ||
"build": { | ||
"cmake-args": ${{ matrix.cmake_args }} | ||
} | ||
} | ||
extra-cmake-args: "-DBUILD_SHARED_LIBS=${{ matrix.cmake_shared_libs }}" | ||
|
||
|
||
# build on Windows native | ||
build_windows: | ||
name: Windows (${{ matrix.ros_distribution }}) | ||
name: "Windows (${{ matrix.ros_distribution }}, shared: ${{ matrix.cmake_shared_libs }})" | ||
|
||
runs-on: windows-2019 | ||
|
||
strategy: | ||
matrix: | ||
ros_distribution: [noetic, humble] | ||
cmake_shared_libs: ['OFF'] | ||
include: | ||
- ros_distribution: noetic | ||
ros_version: 1 | ||
|
@@ -97,36 +84,26 @@ jobs: | |
with: | ||
package-name: apriltag | ||
target-ros1-distro: ${{ matrix.ros_distribution }} | ||
colcon-defaults: | | ||
{ | ||
"build": { | ||
"cmake-args": [ "-DBUILD_SHARED_LIBS=OFF" ] | ||
} | ||
} | ||
extra-cmake-args: "-DBUILD_SHARED_LIBS=${{ matrix.cmake_shared_libs }}" | ||
|
||
- name: ROS 2 CI Action | ||
if: ${{ matrix.ros_version == 2 }} | ||
uses: ros-tooling/[email protected] | ||
with: | ||
package-name: apriltag | ||
target-ros2-distro: ${{ matrix.ros_distribution }} | ||
colcon-defaults: | | ||
{ | ||
"build": { | ||
"cmake-args": [ "-DBUILD_SHARED_LIBS=OFF" ] | ||
} | ||
} | ||
extra-cmake-args: "-DBUILD_SHARED_LIBS=${{ matrix.cmake_shared_libs }}" | ||
|
||
# build on macOS native | ||
build_macos: | ||
name: macOS (${{ matrix.ros_distribution }}) | ||
name: "macOS (${{ matrix.ros_distribution }}, shared: ${{ matrix.cmake_shared_libs }})" | ||
|
||
runs-on: macos-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ros_distribution: [humble] | ||
cmake_shared_libs: ['OFF'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -145,9 +122,4 @@ jobs: | |
with: | ||
package-name: apriltag | ||
target-ros2-distro: ${{ matrix.ros_distribution }} | ||
colcon-defaults: | | ||
{ | ||
"build": { | ||
"cmake-args": [ "-DBUILD_PYTHON_WRAPPER=OFF" ] | ||
} | ||
} | ||
extra-cmake-args: "-DBUILD_SHARED_LIBS=${{ matrix.cmake_shared_libs }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.