CI Workflow #179
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
name: CI Workflow | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
- devel | |
schedule: | |
- cron: '0 2 * * *' | |
env: | |
YARP_TAG: v3.8.1 | |
jobs: | |
build: | |
name: '[${{ matrix.os }}@${{ matrix.build_type }}]' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build_type: [Release] | |
os: [ubuntu-20.04, ubuntu-22.04] | |
steps: | |
- uses: actions/checkout@master | |
- name: Remove broken apt repos [Ubuntu] | |
if: contains(matrix.os, 'ubuntu') | |
run: for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | |
- name: Dependencies [Ubuntu] | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install libusb-1.0-0-dev libpthread-stubs0-dev | |
sudo apt-get install build-essential cmake cmake-curses-gui coinor-libipopt-dev freeglut3-dev git libace-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libedit-dev libeigen3-dev libgsl0-dev libjpeg-dev liblua5.1-dev libode-dev libopencv-dev libsdl1.2-dev libtinyxml-dev libv4l-dev libxml2-dev lua5.1 portaudio19-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtmultimedia qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick-window2 qml-module-qtquick2 qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev swig libmatio-dev | |
- name: Cache dependencies from source [Ubuntu] | |
id: cache-src-deps | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ github.workspace }}/install | |
key: src-deps-${{ runner.os }}-os-${{ matrix.os }}-build-${{ matrix.build_type }}-yarp-${{ env.YARP_TAG }} | |
- name: Dependencies (from source) [Ubuntu] | |
if: steps.cache-src-deps.outputs.cache-hit != 'true' && contains(matrix.os, 'ubuntu') | |
run: | | |
# YCM | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/ycm | |
cd ycm | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. | |
cmake --build . --config ${{ matrix.build_type }} --target install | |
# YARP | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/yarp | |
cd yarp | |
git checkout ${{ env.YARP_TAG }} | |
mkdir build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. | |
cmake --build . --config ${{ matrix.build_type }} --target install | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure CMake [Ubuntu] | |
if: contains(matrix.os, 'ubuntu') | |
shell: bash | |
working-directory: ${{runner.workspace}}/build | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
- name: Build | |
working-directory: ${{runner.workspace}}/build | |
shell: bash | |
run: cmake --build . --config ${{matrix.build_type}} |