Skip to content

CI Tweaks

CI Tweaks #936

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
jobs:
cmake:
name: cmake (${{ matrix.ros_distro }}, ${{ matrix.preset }}, ${{ matrix.compiler.name }})
strategy:
matrix:
ros_distro: [humble, rolling]
preset: [debug, release, asan, codecov]
compiler:
- { name: GCC }
- { name: Clang, flags: -DCMAKE_CXX_COMPILER=clang++ }
exclude:
- preset: codecov
compiler: { name: Clang }
runs-on: ubuntu-22.04
container: ghcr.io/picknikrobotics/rsl:upstream-${{ matrix.ros_distro }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Cache ccache
uses: pat-s/always-upload-cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}-${{ github.sha }}
ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}
- name: Source ROS
run: |
. /opt/ros/${{ matrix.ros_distro }}/setup.sh
echo "$(env)" >> $GITHUB_ENV
- name: Install Clang
if: matrix.compiler.name == 'clang'
run: sudo apt update && sudo apt install clang
- name: Configure
run: cmake --preset ${{ matrix.preset }} ${{ matrix.compiler.flags }} -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build
run: cmake --build build/${{ matrix.preset }} --target install
- name: Test
run: ctest --test-dir build/${{ matrix.preset }} --rerun-failed --output-on-failure
- name: Build Doxygen Site
run: cmake --build build/${{ matrix.preset }} --target docs
- name: Analyze
run: cmake --build build/${{ matrix.preset }} --target tidy
- name: Generate LCOV report
if: ${{ matrix.preset == 'codecov' }}
run: lcov -c -d . -o coverage.info --no-external --exclude "*/build/**"
- uses: codecov/codecov-action@v3
if: ${{ matrix.preset == 'codecov' }}
with:
files: ./coverage.info
name: codecov-umbrella
flags: ${{ matrix.ros_distro }}
ros:
strategy:
matrix:
ros_distro: [humble, rolling]
runs-on: ubuntu-22.04
container: ghcr.io/picknikrobotics/rsl:upstream-${{ matrix.ros_distro }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Cache ccache
uses: pat-s/always-upload-cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-ros-${{ matrix.ros_distro }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-ros-${{ matrix.ros_distro }}-${{ github.sha }}
ccache-ros-${{ matrix.ros_distro }}
- uses: ros-tooling/[email protected]
with:
package-name: rsl
target-ros2-distro: ${{ matrix.ros_distro }}
colcon-defaults: |
{
"build": {
"mixin": ["ccache", "lld"]
}
}