CI Workflow #6453
This file contains hidden or 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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - 'releases/**' | |
| tags: | |
| - v* | |
| pull_request: | |
| release: | |
| types: [published] | |
| schedule: | |
| # * is a special character in YAML so you have to quote this string | |
| # Execute a "nightly" build at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| jobs: | |
| conda-build: | |
| name: '[conda:Tags:${{ matrix.project_tags }}@${{ matrix.os }}@${{ matrix.build_type }}]' | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| build_type: [Release] | |
| os: [ubuntu-latest, windows-2022] | |
| project_tags: | |
| - Default | |
| - Unstable | |
| - LatestReleases | |
| include: | |
| - project_tags: Default | |
| project_tags_cmake_options: "" | |
| - project_tags: Unstable | |
| project_tags_cmake_options: "-DROBOTOLOGY_PROJECT_TAGS=Unstable" | |
| - project_tags: LatestReleases | |
| project_tags_cmake_options: "-DROBOTOLOGY_PROJECT_TAGS=Custom -DROBOTOLOGY_PROJECT_TAGS_CUSTOM_FILE=${GITHUB_WORKSPACE}/releases/latest.releases.yaml" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-variant: Miniforge3 | |
| - uses: mathio/gha-cleanup@v1 | |
| if: contains(matrix.os, 'ubuntu') | |
| with: | |
| remove-browsers: true | |
| verbose: true | |
| - name: Install files to enable compilation of mex files [Conda/Linux] | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020b_mexa64.zip | |
| unzip msdk_R2020b_mexa64.zip | |
| rm msdk_R2020b_mexa64.zip | |
| echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020b_mexa64" >> $GITHUB_ENV | |
| echo "GHA_Matlab_MEX_EXTENSION=mexa64" >> $GITHUB_ENV | |
| - name: Install files to enable compilation of mex files [Conda/Windows] | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexw64.zip | |
| unzip msdk_R2020a_mexw64.zip | |
| rm msdk_R2020a_mexw64.zip | |
| echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexw64" >> $GITHUB_ENV | |
| echo "GHA_Matlab_MEX_EXTENSION=mexw64" >> $GITHUB_ENV | |
| - name: Dependencies [Conda] | |
| shell: bash -l {0} | |
| run: | | |
| # Dependencies | |
| conda install ace asio assimp libboost-devel cli11 eigen freetype gz-sim8 glew glfw glm graphviz gsl "ipopt>=3.13.0" irrlicht libjpeg-turbo libmatio libode libxml2 nlohmann_json qhull "pcl>=1.11.1" vtk "libopencv>=4.10.0" opencv portaudio qt-main sdl sdl2 sqlite tinyxml spdlog lua soxr cmake cxx-compiler make ninja pkg-config tomlplusplus libzlib ffmpeg onnxruntime-cpp "qt6-main>=6.7.2" catch2 gtest python numpy swig pybind11 qtpy pyqt pyqtgraph pyqtwebengine pyside2 matplotlib h5py tornado u-msgpack-python pyzmq ipython gst-plugins-good gst-plugins-bad gst-libav pyyaml | |
| # Additional dependencies useful only on Linux | |
| - name: Dependencies [Conda/Linux] | |
| if: contains(matrix.os, 'ubuntu') | |
| shell: bash -l {0} | |
| run: | | |
| # Additional dependencies only useful on Linux | |
| # See https://github.com/robotology/robotology-superbuild/issues/477 | |
| conda install bash-completion freeglut libdc1394 libi2c xorg-libxau libxcb xorg-libxdamage xorg-libxext xorg-libxfixes xorg-libxxf86vm xorg-libxrandr libgl-devel mold | |
| # Additional dependencies useful only on Windows | |
| - name: Dependencies [Conda/Windows] | |
| if: contains(matrix.os, 'windows') | |
| shell: bash -l {0} | |
| run: | | |
| # Additional dependencies only useful on Windows | |
| conda install -c conda-forge -c robotology esdcan freeglut | |
| - name: Print used environment [Conda] | |
| shell: bash -l {0} | |
| run: | | |
| conda list | |
| env | |
| - name: Set CMake generator [Conda/Linux] | |
| if: contains(matrix.os, 'ubuntu') | |
| shell: bash -l {0} | |
| run: | | |
| echo "GHA_CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV | |
| - name: Set CMake generator [Conda/Windows 2022] | |
| if: contains(matrix.os, 'windows-2022') | |
| shell: bash -l {0} | |
| run: | | |
| echo "GHA_CMAKE_GENERATOR=Visual Studio 17 2022" >> $GITHUB_ENV | |
| - name: Configure [Conda] | |
| shell: bash -l {0} | |
| run: | | |
| set | |
| mkdir -p b | |
| cd b | |
| cmake -G"${GHA_CMAKE_GENERATOR}" -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -DYCM_EP_ADDITIONAL_CMAKE_ARGS:STRING="-DMatlab_ROOT_DIR:PATH=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION}" -DROBOTOLOGY_USES_MATLAB:BOOL=ON -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.project_tags_cmake_options }} .. | |
| # Disable options not tested on Conda for now | |
| cmake -DROBOTOLOGY_USES_OCTAVE:BOOL=OFF . | |
| # For some reason, the Strawberry perl's pkg-config is found | |
| # instead of the conda's one, so let's delete the /c/Strawberry directory | |
| - name: Debug pkg-config problem | |
| if: contains(matrix.os, 'windows') | |
| shell: bash -l {0} | |
| run: | | |
| rm -rf /c/Strawberry | |
| - name: Build [Conda] | |
| shell: bash -l {0} | |
| run: | | |
| # Using b instead of build as a temporary workaround to https://github.com/robotology/robotology-superbuild/issues/1542#issuecomment-1827682957 | |
| # Go back to build once https://github.com/robotology/yarp/pull/3057 is merged and released | |
| cd b | |
| # Make sure that (on Windows) YARP's dll are in the path in case some repos use a code generator | |
| # in their build that uses YARP's dll | |
| # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 | |
| source ./install/share/robotology-superbuild/setup.sh | |
| cmake --build . --config ${{ matrix.build_type }} | |
| - name: Check python metadata of installed python packages are coherent [Conda] | |
| shell: bash -l {0} | |
| run: | | |
| source ./b/install/share/robotology-superbuild/setup.sh | |
| pip check | |
| docker-build: | |
| name: '[docker:Tags:${{ matrix.project_tags }}@${{ matrix.docker_image }}@${{ matrix.build_type }}]' | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| build_type: [Debug] | |
| cmake_generator: | |
| - "Ninja" | |
| docker_image: | |
| - "ubuntu:22.04" | |
| - "ubuntu:24.04" | |
| project_tags: | |
| - Default | |
| - Unstable | |
| include: | |
| - project_tags: Default | |
| project_tags_cmake_options: "" | |
| - project_tags: Unstable | |
| project_tags_cmake_options: "-DROBOTOLOGY_PROJECT_TAGS=Unstable" | |
| container: | |
| image: ${{ matrix.docker_image }} | |
| volumes: | |
| - /usr/local:/host_usr_local | |
| steps: | |
| - uses: actions/checkout@v3.6.0 | |
| - name: Free disk space in host machine | |
| run: | | |
| rm -rf /host_usr_local/graalvm/ | |
| rm -rf /host_usr_local/.ghcup/ | |
| rm -rf /host_usr_local/share/powershell | |
| rm -rf /host_usr_local/share/chromium | |
| rm -rf /host_usr_local/lib/android | |
| rm -rf /host_usr_local/lib/node_modules | |
| - name: Dependencies [Docker] | |
| run: | | |
| chmod +x ./.ci/install_debian.sh | |
| bash ./.ci/install_debian.sh | |
| - name: Configure [Docker] | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -G"${{ matrix.cmake_generator }}" -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.project_tags_cmake_options }} .. | |
| - name: Build [Docker] | |
| run: | | |
| cd build | |
| cmake --build . --config ${{ matrix.build_type }} | |
| normal-build: | |
| name: '[Tags:${{ matrix.project_tags }}@${{ matrix.os }}@${{ matrix.build_type }}]' | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| build_type: [Release] | |
| os: [ubuntu-22.04, windows-2022] | |
| project_tags: [Default, Unstable, LatestReleases] | |
| include: | |
| - os: ubuntu-22.04 | |
| build_type: Release | |
| cmake_generator: "Ninja" | |
| - project_tags: Default | |
| project_tags_cmake_options: "" | |
| - project_tags: Unstable | |
| project_tags_cmake_options: "-DROBOTOLOGY_PROJECT_TAGS=Unstable" | |
| - project_tags: LatestReleases | |
| project_tags_cmake_options: "-DROBOTOLOGY_PROJECT_TAGS=Custom -DROBOTOLOGY_PROJECT_TAGS_CUSTOM_FILE=${GITHUB_WORKSPACE}/releases/latest.releases.yaml" | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Install files to enable compilation of mex files [Linux] | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020b_mexa64.zip | |
| unzip msdk_R2020b_mexa64.zip | |
| rm msdk_R2020b_mexa64.zip | |
| echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020b_mexa64" >> $GITHUB_ENV | |
| echo "GHA_Matlab_MEX_EXTENSION=mexa64" >> $GITHUB_ENV | |
| - name: Move robotology-superbuild in C under Windows | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| ls /d/ | |
| cp -r ${GITHUB_WORKSPACE} /c/ | |
| - name: Define ROBOTOLOGY_SUPERBUILD_SOURCE_DIR | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| echo "ROBOTOLOGY_SUPERBUILD_SOURCE_DIR=/c/robotology-superbuild" >> $GITHUB_ENV | |
| - name: Define ROBOTOLOGY_SUPERBUILD_SOURCE_DIR | |
| if: contains(matrix.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| echo "ROBOTOLOGY_SUPERBUILD_SOURCE_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV | |
| - name: Check free space | |
| shell: bash | |
| run: | | |
| df -h | |
| # Print environment variables to simplify development and debugging | |
| - name: Environment Variables | |
| shell: bash | |
| run: env | |
| # Remove apt repos that are known to break from time to time | |
| # See https://github.com/actions/virtual-environments/issues/323 | |
| - 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 | |
| # symlinks disabled are the default setting on Windows, but unfortunatly GitHub Actions enabled them | |
| # See: | |
| # * https://github.com/robotology/robotology-superbuild/issues/429 | |
| # * https://github.com/actions/virtual-environments/pull/1186 | |
| - name: Disable Git symlinks on Windows | |
| if: contains(matrix.os, 'windows') | |
| run: git config --global core.symlinks false | |
| # ============ | |
| # DEPENDENCIES | |
| # ============ | |
| # Waiting a github action that installs dependencies in a | |
| # multiplatform setup (likely using TS or JS), we install | |
| # packages with os-specific steps. | |
| - name: Dependencies [Ubuntu] | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| cd $ROBOTOLOGY_SUPERBUILD_SOURCE_DIR | |
| chmod +x ./.ci/install_debian.sh | |
| sudo bash ./.ci/install_debian.sh | |
| - name: Dependencies [Windows] | |
| if: contains(matrix.os, 'windows') | |
| run: | | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| # To avoid spending a huge time compiling vcpkg dependencies, we download an archive that comes precompiled with all the ports that we need | |
| choco install -y wget unzip | |
| # To avoid problems with non-relocatable packages, we unzip the archive exactly in the same directory | |
| # that has been used to create the pre-compiled archive | |
| cd C:/ | |
| wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/latest/download/vcpkg-robotology-with-gazebo.zip | |
| unzip vcpkg-robotology-with-gazebo.zip -d C:/ | |
| rm vcpkg-robotology-with-gazebo.zip | |
| # =================== | |
| # CMAKE-BASED PROJECT | |
| # =================== | |
| - name: Configure [Ubuntu] | |
| if: contains(matrix.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| mkdir -p build | |
| cd build | |
| cmake -C ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR}/.ci/initial-cache.gh.cmake -G"${{ matrix.cmake_generator }}" -DYCM_EP_ADDITIONAL_CMAKE_ARGS:STRING="-DMatlab_ROOT_DIR:PATH=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION}" -DROBOTOLOGY_USES_MATLAB:BOOL=ON -DYCM_BOOTSTRAP_VERBOSE=ON -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.project_tags_cmake_options }} .. | |
| # Workaround for https://github.com/robotology/robotology-superbuild/issues/1680 | |
| - name: Define CMAKE_CONFIGURATION_TYPES | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| echo "CMAKE_CONFIGURATION_TYPES=Debug;Release" >> $GITHUB_ENV | |
| - name: Configure [Windows] | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| # Workaround for https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7721 | |
| mv C:/robotology/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe C:/robotology/vcpkg/installed/x64-windows/tools/pkgconf/pkgconfback.exe | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| # Make sure that Gazebo packages can be found by CMake | |
| source /c/robotology/scripts/setup-deps.sh | |
| mkdir -p build | |
| cd build | |
| # ROBOTOLOGY_ENABLE_TELEOPERATION is OFF as it is unsupported on vcpkg | |
| cmake -C ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR}/.ci/initial-cache.gh.cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/robotology/vcpkg/scripts/buildsystems/vcpkg.cmake -DROBOTOLOGY_USES_MATLAB:BOOL=OFF -DYCM_BOOTSTRAP_VERBOSE=ON -DYCM_EP_INSTALL_DIR=C:/robotology/robotology -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=Debug ${{ matrix.project_tags_cmake_options }} .. | |
| cmake -DROBOTOLOGY_ENABLE_TELEOPERATION:BOOL=OFF . | |
| - name: Disable options unsupported on vcpkg | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| cd build | |
| cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . | |
| - name: Build [Ubuntu] | |
| if: contains(matrix.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| cd build | |
| cmake --build . --config ${{ matrix.build_type }} | |
| # Just for release jobs we also compile Windows in Release, to ensure that Release libraries are included in the installer | |
| - name: Build (Release) [Windows] | |
| if: github.event_name == 'release' && matrix.project_tags == 'Default' && contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| cd build | |
| # Make sure that vcpkg's ace .dll are on the PATH | |
| source /c/robotology/scripts/setup-deps.sh | |
| # Make sure that YARP's dll are in the path in case some repos use a code generator | |
| # in their build that uses YARP's dll | |
| # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 | |
| source /c/robotology/robotology/share/robotology-superbuild/setup.sh | |
| cmake --build . --config Release | |
| # Cleanup build directories to avoid to fill the disk | |
| rm -rf ./robotology | |
| - name: Build (Debug) [Windows] | |
| if: contains(matrix.os, 'windows') | |
| shell: bash | |
| run: | | |
| cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} | |
| cd build | |
| # Make sure that vcpkg's ace .dll are on the PATH | |
| source /c/robotology/scripts/setup-deps.sh | |
| # Make sure that YARP's dll are in the path in case some repos use a code generator | |
| # in their build that uses YARP's dll | |
| # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 | |
| source /c/robotology/robotology/share/robotology-superbuild/setup.sh | |
| cmake --build . --config Debug | |
| # Cleanup build directories to avoid to fill the disk | |
| rm -rf ./robotology | |
| # Just for release builds we generate the installer | |
| - name: Generate installer [Windows] | |
| if: github.event_name == 'release' && matrix.project_tags == 'Default' && matrix.os == 'windows-2022' | |
| shell: bash | |
| run: | | |
| # Download QtIFW | |
| cd /c | |
| certutil.exe -urlcache -split -f https://github.com/robotology-dependencies/qtifw-binaries/releases/download/v3.1.1/QtIFW-3.1.1.zip QtIFW-3.1.1.zip | |
| 7z.exe x QtIFW-3.1.1.zip | |
| export PATH=$PATH:/c/QtIFW-3.1.1/bin | |
| # As we need a lot of space, we build the installer in the C:\ drive | |
| # that has more space of the D:\ drive in GitHub Actions | |
| mkdir /c/build-installer-full | |
| cd /c/build-installer-full | |
| cmake -A x64 -DRI_BUILD_FULL_INSTALLER:BOOL=ON ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR}/packaging/windows | |
| cmake --build . --config Release --target PACKAGE | |
| # Move installer in installer directory with a fixed name | |
| mv *.exe /c/robotology-full-installer-win64.exe | |
| # Cleanup and build dependencies installer | |
| cd /c | |
| rm -rf /c/build-installer-full | |
| mkdir /c/build-installer-dependencies | |
| cd /c/build-installer-dependencies | |
| cmake -A x64 -DRI_BUILD_FULL_INSTALLER:BOOL=OFF ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR}/packaging/windows | |
| cmake --build . --config Release --target PACKAGE | |
| # Move installer in installer directory with a fixed name | |
| mv *.exe /c/robotology-dependencies-installer-win64.exe | |
| - name: Upload Full Installer [Windows] | |
| if: github.event_name == 'release' && matrix.project_tags == 'Default' && matrix.os == 'windows-2022' | |
| uses: actions/upload-release-asset@v1.0.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: C:/robotology-full-installer-win64.exe | |
| asset_name: robotology-full-installer-win64.exe | |
| asset_content_type: application/octet-stream | |
| - name: Upload Dependencies installer [Windows] | |
| if: github.event_name == 'release' && matrix.project_tags == 'Default' && matrix.os == 'windows-2022' | |
| uses: actions/upload-release-asset@v1.0.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: C:/robotology-dependencies-installer-win64.exe | |
| asset_name: robotology-dependencies-installer-win64.exe | |
| asset_content_type: application/octet-stream |