From e1b1c1c35c2fa823978354f33334993f7363d961 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Fri, 19 Jul 2024 10:36:03 -0500 Subject: [PATCH] CI Update (#113) * Updated Ubuntu and Windows jobs * Updated README * Updated lint jobs --- .github/workflows/clang_format.yml | 2 - .github/workflows/cmake_format.yml | 4 +- .github/workflows/ubuntu.yml | 43 +++++++++++++ .github/workflows/ubuntu_bionic.yml | 43 ------------- .github/workflows/ubuntu_focal.yml | 44 ------------- .github/workflows/windows.yml | 63 +++++++++++++++++++ .github/workflows/windows_2019.yml | 60 ------------------ README.md | 14 ++--- dependencies.rosinstall => dependencies.repos | 0 9 files changed, 113 insertions(+), 160 deletions(-) create mode 100644 .github/workflows/ubuntu.yml delete mode 100644 .github/workflows/ubuntu_bionic.yml delete mode 100644 .github/workflows/ubuntu_focal.yml create mode 100644 .github/workflows/windows.yml delete mode 100644 .github/workflows/windows_2019.yml rename dependencies.rosinstall => dependencies.repos (100%) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index f2537343..255f388e 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -5,8 +5,6 @@ on: branches: - master pull_request: - schedule: - - cron: '0 5 * * *' jobs: clang_format: diff --git a/.github/workflows/cmake_format.yml b/.github/workflows/cmake_format.yml index 959533e3..559152f5 100644 --- a/.github/workflows/cmake_format.yml +++ b/.github/workflows/cmake_format.yml @@ -5,12 +5,10 @@ on: branches: - master pull_request: - schedule: - - cron: '0 5 * * *' jobs: cmake_lang: - name: Format + name: CMake-Format runs-on: ubuntu-latest steps: - uses: actions/checkout@master diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..dd88334d --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,43 @@ +name: Ubuntu [Focal, Jammy, Noble] + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + ci: + name: ${{ matrix.distro }} + runs-on: ubuntu-latest + container: + image: ubuntu:${{ matrix.distro }} + env: + DEBIAN_FRONTEND: noninteractive + strategy: + fail-fast: false + matrix: + distro: [focal, jammy, noble] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: target_ws/src + + - name: Install dependencies + run: | + apt update -q + apt install -q -y clang-tidy + + - name: Build and test + uses: tesseract-robotics/colcon-action@v9 + with: + ccache-enabled: false + add-ros-ppa: true + rosdep-enabled: true + vcs-file: dependencies.repos + target-path: target_ws/src + target-args: --cmake-args -DCMAKE_BUILD_TYPE=Debug -DDESCARTES_ENABLE_TESTING=ON -DDESCARTES_ENABLE_CLANG_TIDY=ON + run-tests: true diff --git a/.github/workflows/ubuntu_bionic.yml b/.github/workflows/ubuntu_bionic.yml deleted file mode 100644 index 6f98e9cb..00000000 --- a/.github/workflows/ubuntu_bionic.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Ubuntu-Bionic - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * *' - -jobs: - ci: - name: Ubuntu-Bionic - runs-on: ubuntu-latest - container: ubuntu:bionic - steps: - - name: Checkout repository - uses: actions/checkout@master - with: - path: src/descartes_light - - - name: Install dependencies - run: | - apt update -q - apt install -q -y clang-tidy python3 python3-pip python3-setuptools git - pip3 install -q --upgrade pip - pip3 install -q colcon-common-extensions rosdep vcstool - rosdep init -q - rosdep update -q - vcs import src < src/descartes_light/dependencies.rosinstall - rosdep install --from-paths src --ignore-src -r -y -q - - - name: Build - run: | - colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Debug -DDESCARTES_ENABLE_TESTING=ON -DDESCARTES_ENABLE_CLANG_TIDY=ON - if [ $? -ne 0 ]; then exit 1; fi - - - name: Test - run: | - colcon test --event-handlers console_direct+ - if [ $? -ne 0 ]; then exit 1; fi - colcon test-result --verbose - if [ $? -ne 0 ]; then exit 1; fi diff --git a/.github/workflows/ubuntu_focal.yml b/.github/workflows/ubuntu_focal.yml deleted file mode 100644 index b90f9ab8..00000000 --- a/.github/workflows/ubuntu_focal.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Ubuntu-Focal - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * *' - -jobs: - ci: - name: Ubuntu-Focal - runs-on: ubuntu-latest - container: ubuntu:focal - steps: - - name: Checkout repository - uses: actions/checkout@master - with: - path: src/descartes_light - - - name: Install dependencies - run: | - export DEBIAN_FRONTEND=noninteractive - apt update -q - apt install -q -y clang-tidy python3 python3-pip git - pip3 install -q --upgrade pip - pip3 install -q colcon-common-extensions rosdep vcstool - rosdep init -q - rosdep update -q - vcs import src < src/descartes_light/dependencies.rosinstall - rosdep install --from-paths src --ignore-src -r -y -q - - - name: Build - run: | - colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Debug -DDESCARTES_ENABLE_TESTING=ON -DDESCARTES_ENABLE_CLANG_TIDY=ON - if [ $? -ne 0 ]; then exit 1; fi - - - name: Test - run: | - colcon test --event-handlers console_direct+ - if [ $? -ne 0 ]; then exit 1; fi - colcon test-result --verbose - if [ $? -ne 0 ]; then exit 1; fi diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..5e86b6bc --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,63 @@ +name: Windows [2019, 2022] + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + ci: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2019, windows-2022] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: target_ws/src + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.28.x' + + - name: vcpkg build + uses: johnwason/vcpkg-action@v6 + with: + pkgs: console-bridge eigen3 boost-graph gtest + triplet: x64-windows-release + extra-args: --clean-after-build + token: ${{ github.token }} + cache-key: ci-${{ matrix.os }} + github-binarycache: true + revision: 2024.01.12 + + - name: configure-msvc + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - name: update environment + shell: bash + run: | + echo "PATH=${{ env.PATH }};$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release\bin" >> "$GITHUB_ENV" + echo "CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release" >> "$GITHUB_ENV" + + - name: Build and Tests + uses: tesseract-robotics/colcon-action@v9 + with: + ccache-prefix: ${{ matrix.os }} + rosdep-enabled: false + add-ros-ppa: false + vcs-file: dependencies.repos + upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release + target-path: target_ws/src + target-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DDESCARTES_ENABLE_TESTING=ON + run-tests: true diff --git a/.github/workflows/windows_2019.yml b/.github/workflows/windows_2019.yml deleted file mode 100644 index a93e9d77..00000000 --- a/.github/workflows/windows_2019.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Windows-2019 - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * *' - -jobs: - windows_ci: - name: Windows-2019 - runs-on: windows-2019 - steps: - - name: Checkout repository - uses: actions/checkout@master - with: - path: workspace/src/descartes_light - - - name: vcpkg build - uses: johnwason/vcpkg-action@v6 - with: - pkgs: boost-graph eigen3 console-bridge gtest - triplet: x64-windows-release - token: ${{ github.token }} - github-binarycache: true - - - name: install-depends - shell: cmd - working-directory: vcpkg - run: | - vcpkg integrate install - python -m pip install vcstool colcon-common-extensions ninja -q - - - name: configure-msvc - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - - - name: build-workspace - working-directory: workspace - shell: cmd - run: | - set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1 - set CMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release - set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release\bin - vcs import src < src/descartes_light/dependencies.rosinstall - colcon build --event-handlers console_direct+ --cmake-args -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DDESCARTES_ENABLE_TESTING=ON -DVCPKG_APPLOCAL_DEPS=OFF - if %ERRORLEVEL% GEQ 1 exit 1 - - - name: run-test - working-directory: workspace - shell: cmd - run: | - set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release\bin - colcon test --event-handlers console_direct+ - if %ERRORLEVEL% GEQ 1 exit 1 - colcon test-result --verbose - if %ERRORLEVEL% GEQ 1 exit 1 diff --git a/README.md b/README.md index 20343406..b852cc04 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,9 @@ This package is intented to be a simple ladder graph building library. The core ## Build Status -Platform | CI Status ----------------------|:--------- -Linux (Bionic) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu_bionic.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu_bionic.yml) -Linux (Focal) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu_focal.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu_focal.yml) -Windows | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/windows_2019.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/windows_2019.yml) -Lint (Clang-Format) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/clang_format.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/clang_format.yml) -Lint (CMake-Format) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/cmake_format.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/cmake_format.yml) - +Platform | CI Status +-----------------------------|:--------- +Ubuntu (Focal, Jammy, Noble) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/ubuntu.yml) +Windows (2019, 2022) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/windows.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/windows.yml) +Lint (Clang-Format) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/clang_format.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/clang_format.yml) +Lint (CMake-Format) | [![Build Status](https://github.com/swri-robotics/descartes_light/actions/workflows/cmake_format.yml/badge.svg)](https://github.com/swri-robotics/descartes_light/actions/workflows/cmake_format.yml) diff --git a/dependencies.rosinstall b/dependencies.repos similarity index 100% rename from dependencies.rosinstall rename to dependencies.repos