Skip to content

Continuous Integration #760

Continuous Integration

Continuous Integration #760

Workflow file for this run

name: Continuous Integration
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- 'firmware/**'
pull_request:
schedule:
- cron: '0 0 * * MON'
workflow_dispatch:
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_BUILD_TYPE: Debug
ARAVIS_VER: ARAVIS_0_6_4
PEAK_DRIVER_VER: 8.11.0
jobs:
maybe_skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{steps.skip_check.outputs.should_skip}}
steps:
- uses: fkirc/skip-duplicate-actions@v5
id: skip_check
with:
cancel_others: 'true'
build:
name: build (${{matrix.system.os}}, ${{matrix.robotology.yarp}}, ${{matrix.system.compiler.cc}})
runs-on: ${{matrix.system.os}}
needs: maybe_skip
if: ${{needs.maybe_skip.outputs.should_skip != 'true'}}
strategy:
fail-fast: false
matrix:
system:
- { os: ubuntu-22.04, compiler: { cc: gcc-11, cxx: g++-11 } }
# https://github.com/roboticslab-uc3m/questions-and-answers/issues/101
- { os: ubuntu-22.04, compiler: { cc: clang-15, cxx: clang++-15 } }
- { os: ubuntu-24.04, compiler: { cc: gcc-13, cxx: g++-13 } }
- { os: ubuntu-24.04, compiler: { cc: clang-18, cxx: clang++-18 } }
robotology:
# CMake 3.22 instead of 3.19 because of the CMAKE_BUILD_TYPE env var
- { yarp: yarp-3.11, cmake: 3.22.x }
- { yarp: yarp-3.12, cmake: 3.22.x }
- { yarp: master, cmake: 3.22.x }
experimental:
- ${{github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
exclude:
- { experimental: false, robotology: { yarp: master } }
steps:
- name: Check out main project
uses: actions/checkout@v4
- name: Check out YCM
uses: actions/checkout@v4
with:
repository: robotology/ycm
path: .deps/ycm
- name: Check out YARP
uses: actions/checkout@v4
with:
repository: robotology/yarp
ref: ${{matrix.robotology.yarp}}
path: .deps/yarp
- name: Download ARAVIS
run: wget -O- -q https://github.com/AravisProject/aravis/archive/refs/tags/$ARAVIS_VER.tar.gz | tar -C .deps -xzf -
- name: Download libphidget21
run: wget -O- -q https://sourceforge.net/projects/roboticslab/files/External/phidget/libphidget_2.1.8.20151217.tar.gz | tar -C .deps -xzf -
- name: Download Peak CAN driver
run: wget -O- -q https://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-$PEAK_DRIVER_VER.tar.gz | tar -C .deps -xzf -
- name: Check out jr3pci-linux
uses: actions/checkout@v4
with:
repository: roboticslab-uc3m/jr3pci-linux
path: .deps/jr3pci-linux
- name: Install dependencies via apt
run: sudo apt-get update && sudo apt-get install -qq ccache intltool gtk-doc-tools libxml2-dev libglib2.0-dev libusb-1.0-0-dev libspnav-dev libxwiimote-dev libgtest-dev
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{matrix.robotology.cmake}}
- name: Set up Ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{matrix.system.os}}-${{matrix.robotology.yarp}}-${{matrix.system.compiler.cc}}
- name: Set environment variables
run: |
echo "CC=${{matrix.system.compiler.cc}}" >> $GITHUB_ENV
echo "CXX=${{matrix.system.compiler.cxx}}" >> $GITHUB_ENV
- name: Build YCM
run: |
cmake -S .deps/ycm -B .deps/ycm/build
cmake --build .deps/ycm/build
sudo cmake --install .deps/ycm/build
- name: Build YARP
run: |
cmake -S .deps/yarp -B .deps/yarp/build -DSKIP_ACE=ON -DYARP_DISABLE_VERSION_SOURCE=ON
cmake --build .deps/yarp/build
sudo cmake --install .deps/yarp/build
- name: Build ARAVIS
working-directory: .deps/aravis-${{env.ARAVIS_VER}}
run: |
CC="ccache ${{matrix.system.compiler.cc}}" CXX="ccache ${{matrix.system.compiler.cxx}}" ./autogen.sh --enable-gtk-doc-html=no
make -j && sudo make install
- name: Build libphidget21
working-directory: .deps/libphidget-2.1.8.20151217
run: |
CC="ccache ${{matrix.system.compiler.cc}}" CXX="ccache ${{matrix.system.compiler.cxx}}" ./configure --enable-jni=no
make -j && sudo make install
- name: Build Peak CAN driver
working-directory: .deps/peak-linux-driver-${{env.PEAK_DRIVER_VER}}
run: |
CC="ccache ${{matrix.system.compiler.cc}}" CXX="ccache ${{matrix.system.compiler.cxx}}" make -C lib
sudo make -C lib install
sudo cp -f driver/pcan*.h /usr/include
- name: Install jr3pci-linux header
run: sudo make -C .deps/jr3pci-linux install-header
- name: Configure main project
run: cmake -S . -B build -DENABLE_examples=ON
- name: Compile main project
run: cmake --build build
- name: Install main project
run: sudo cmake --install build && sudo ldconfig
- name: Test main project
working-directory: build
run: ctest -V
- name: Uninstall main project
run: sudo cmake --build build --target uninstall