Skip to content

Add Modified dubins to ROS #36

Add Modified dubins to ROS

Add Modified dubins to ROS #36

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: ROS 2 Tests
runs-on: ubuntu-latest
container:
image: ros:jazzy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src/cubs2
- name: Clone cyecca dependency
run: |
# Clone cyecca (workspace dependency)
git clone https://github.com/CogniPilot/cyecca.git src/cyecca
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-ros2-${{ runner.os }}-${{ hashFiles('**/package.xml') }}
restore-keys: |
apt-ros2-${{ runner.os }}-
- name: Cache rosdep
uses: actions/cache@v4
with:
path: /root/.ros/rosdep
key: rosdep-${{ runner.os }}-${{ hashFiles('**/package.xml') }}
restore-keys: |
rosdep-${{ runner.os }}-
- name: Setup package repositories
run: |
# Ensure all Ubuntu repositories are enabled
apt-get update
apt-get install -y software-properties-common ccache curl
# Enable universe and multiverse repositories (needed for Python packages)
add-apt-repository -y universe
add-apt-repository -y multiverse
# Refresh package lists
apt-get update
- name: Setup ccache
uses: actions/cache@v4
with:
path: /root/.ccache
key: ccache-${{ runner.os }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=500M
ccache --set-config=compression=true
echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: Initialize rosdep
run: |
# Initialize rosdep
rosdep init || echo "rosdep already initialized"
rosdep update
- name: Install project dependencies
run: |
# Install all system dependencies via rosdep, skipping workspace dependencies
rosdep install --from-paths src --ignore-src -r -y
# Install pytest-cov for coverage reporting and scipy for cyecca
apt-get install -y python3-pytest-cov python3-scipy
- name: Cache CasADi
id: cache-casadi
uses: actions/cache@v4
with:
path: /tmp/casadi.deb
key: casadi-3.6.3-328
- name: Download CasADi
if: steps.cache-casadi.outputs.cache-hit != 'true'
run: |
curl -L -o /tmp/casadi.deb https://github.com/CogniPilot/helmet/raw/main/install/resources/casadi-3.6.3-328.0d8030d49-Linux.deb
- name: Install CasADi
run: |
apt-get install -y /tmp/casadi.deb
- name: Cache colcon workspace
uses: actions/cache@v4
with:
path: |
build
install
key: colcon-${{ runner.os }}-${{ hashFiles('**/package.xml', '**/*.cmake', 'src/**/*.cpp', 'src/**/*.hpp', 'src/cubs2/**/*.py') }}
restore-keys: |
colcon-${{ runner.os }}-
- name: Build
run: |
. /opt/ros/jazzy/setup.sh
cd src/cubs2
make build CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
env:
CCACHE_DIR: /root/.ccache
- name: ccache statistics
run: ccache -s
- name: Run ROS 2 tests and linting
run: |
. /opt/ros/jazzy/setup.sh
. install/setup.sh
cd src/cubs2
make test-verbose
- name: Generate coverage report
run: |
. /opt/ros/jazzy/setup.sh
. install/setup.sh
cd src/cubs2
make coverage
- name: Upload Python coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage_python.xml
flags: python
name: python-coverage
- name: Upload C++ coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage_cpp_filtered.info
flags: cpp
name: cpp-coverage