Skip to content
name: ROS2 Build and Test CI
on:
push:
workflow_dispatch:
jobs:
build_and_test:
runs-on: ubuntu-20.04
container:
image: hashaam1217/subbots_triton_testing:1.0.1
steps:
- name: Ensure Permissions
run: |
sudo mkdir -p /__w/_temp
sudo mkdir -p /__w/_actions
sudo chmod -R 777 /__w/_temp
sudo chmod -R 777 /__w/_actions
# Cleaning up disk space
- name: Clean up disk space
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/cache/apt/*
sudo rm -rf /usr/share/man/??
sudo rm -rf /usr/share/man/??_*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
- name: Update and upgrade
run: |
sudo apt update -y
sudo apt upgrade -y
- name: Install CUDA
run: |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt-get update
sudo apt-get -y install cuda libcudnn8 libcudnn8-dev
- name: Set CUDA paths
run: |
echo "/usr/local/cuda/lib64" >> $GITHUB_PATH
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
- name: Check out ubc-subbots/triton
uses: actions/checkout@v3 # Update to the latest version.
- name: Install deps with rosdep
run: |
rosdep init
rosdep update --include-eol
rosdep install -i --from-path src --rosdistro foxy -y
- name: Cache OpenCV
id: opencv-cache
uses: actions/cache@v3 # Update to the latest version
with:
path: ./opencv-install
key: ${{ runner.os }}-opencv-cache
- name: Install OpenCV
uses: rayandrews/with-opencv-action@v1
with:
dir: ./opencv-install
cached: ${{ steps.opencv-cache.outputs.cache-hit }}
opencv-version: '4.5.3'
CMAKE_BUILD_TYPE: RELEASE
ENABLE_PRECOMPILED_HEADERS: OFF
- name: Ignore with colcon build
run: |
touch ./opencv-install/COLCON_IGNORE
- name: Source setup and build then test using colcon
shell: bash
env:
LD_LIBRARY_PATH: /usr/local/lib/
Torch_DIR: ${{ github.workspace }}/libtorch/libtorch/share/cmake/Torch
run: |
source /opt/ros/foxy/setup.bash
source /usr/share/gazebo/setup.sh
colcon build --cmake-args -DCMAKE_CXX_STANDARD=14 -DTorch_DIR=$Torch_DIR
source ./install/setup.bash
colcon test
colcon test-result --verbose