-
Notifications
You must be signed in to change notification settings - Fork 12
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 #6 from mascheiber/action/ros_matrix
add: single ROS workflow action as matrix
- Loading branch information
Showing
5 changed files
with
131 additions
and
133 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,130 @@ | ||
# Copyright (C) 2022 Martin Scheiber and Christian Brommer, | ||
# Control of Networked Systems, University of Klagenfurt, Austria. | ||
# | ||
# All rights reserved. | ||
# | ||
# This software is licensed under the terms of the BSD-2-Clause-License with | ||
# no commercial use allowed, the full terms of which are made available | ||
# in the LICENSE file. No license in patents is granted. | ||
# | ||
# You can contact the author at <martin.scheiber@ieee.org> and | ||
# <christian.brommer@ieee.org>. | ||
|
||
name: ROS | ||
|
||
on: | ||
push: | ||
branches: [ "main", "development" ] | ||
pull_request: | ||
branches: [ "main", "development" ] | ||
|
||
jobs: | ||
ros_ci: | ||
name: ROS ${{ matrix.ROS_DISTRO }} | ||
runs-on: ubuntu-latest | ||
container: ros:${{ matrix.ROS_DISTRO }}-ros-core | ||
strategy: | ||
# fail-fast needs to be false to perform all matrix checks, even if one fails | ||
fail-fast: false | ||
matrix: | ||
ROS_DISTRO: [noetic, melodic, kinetic] | ||
env: | ||
BADGE_CREATION: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'aau-cns' }} | ||
steps: | ||
- name: Create Badge (running) | ||
if: ${{ env.BADGE_CREATION == 'true' }} | ||
uses: schneegans/dynamic-badges-action@v1.4.0 | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9 | ||
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json | ||
label: ${{ matrix.ROS_DISTRO }} | ||
message: running | ||
color: yellow | ||
namedLogo: ROS | ||
style: plastic | ||
|
||
- name: Get newest Git version | ||
run: > | ||
apt update && apt install --no-install-recommends -y | ||
software-properties-common | ||
&& add-apt-repository ppa:git-core/ppa | ||
- name: Install Dependencies | ||
run: > | ||
apt update && apt install --no-install-recommends -y | ||
git | ||
doxygen | ||
graphviz | ||
build-essential | ||
libeigen3-dev | ||
ros-${{ matrix.ROS_DISTRO }}-dynamic-reconfigure | ||
ros-${{ matrix.ROS_DISTRO }}-tf2-ros | ||
- name: Install ROS dependencies (python3) | ||
if: ${{ matrix.ROS_DISTRO == 'noetic' }} | ||
run: > | ||
apt update && apt install --no-install-recommends -y | ||
python3-catkin-tools | ||
- name: Install ROS dependencies (python2) | ||
if: ${{ matrix.ROS_DISTRO != 'noetic' }} | ||
run: > | ||
apt update && apt install --no-install-recommends -y | ||
python-catkin-tools | ||
- name: Create Catkin Workspace | ||
run: mkdir -p ${{github.workspace}}/flightstack_cws | ||
|
||
- name: Checkout Latest Version | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{github.workspace}}/catkin_ws/src | ||
submodules: recursive | ||
|
||
- name: Build Debug | ||
working-directory: ${{github.workspace}}/catkin_ws | ||
run: /bin/bash -c '. /opt/ros/${{ matrix.ROS_DISTRO }}/setup.bash; catkin build -DCMAKE_BUILD_TYPE=Debug; catkin clean -y;' | ||
|
||
- name: Build Release | ||
working-directory: ${{github.workspace}}/catkin_ws | ||
run: /bin/bash -c '. /opt/ros/${{ matrix.ROS_DISTRO }}/setup.bash; catkin build -DCMAKE_BUILD_TYPE=Release; catkin clean -y;' | ||
|
||
- name: Create Badge (success) | ||
if: ${{ success() && env.BADGE_CREATION == 'true' }} | ||
uses: schneegans/dynamic-badges-action@v1.4.0 | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9 | ||
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json | ||
label: ${{ matrix.ROS_DISTRO }} | ||
message: passing | ||
color: green | ||
namedLogo: ROS | ||
style: plastic | ||
|
||
- name: Create Badge (failure) | ||
if: ${{ failure() && env.BADGE_CREATION == 'true' }} | ||
uses: schneegans/dynamic-badges-action@v1.4.0 | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9 | ||
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json | ||
label: ${{ matrix.ROS_DISTRO }} | ||
message: failure | ||
isError: true | ||
namedLogo: ROS | ||
style: plastic | ||
|
||
- name: Create Badge (cancelled) | ||
if: ${{ cancelled() && env.BADGE_CREATION == 'true' }} | ||
uses: schneegans/dynamic-badges-action@v1.4.0 | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9 | ||
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json | ||
label: ${{ matrix.ROS_DISTRO }} | ||
message: cancelled | ||
color: inactive | ||
namedLogo: ROS | ||
style: plastic |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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