From a689d573fb2c1a592bebb3f4121a492f655b6f34 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:41:34 +0200 Subject: [PATCH 1/7] Added CI workflow --- .github/ubuntu20_04.yml | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/ubuntu20_04.yml diff --git a/.github/ubuntu20_04.yml b/.github/ubuntu20_04.yml new file mode 100644 index 0000000..9a9f6fd --- /dev/null +++ b/.github/ubuntu20_04.yml @@ -0,0 +1,53 @@ +name: mav_sensors +on: + pull_request: + branches: + - "master" + push: + branches: + - "master" + - "feature/ci" + +jobs: + build: + runs-on: [self-hosted, linux] + strategy: + fail-fast: false + matrix: + rosdistro: ['noetic'] + gcc: ['8', '9', '10'] + container: ros:${{ matrix.rosdistro }}-ros-base-focal + name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }} + steps: + - uses: actions/checkout@v4 + name: Checkout lpp + with: + repository: ethz-asl/lpp + token: ${{ secrets.PAT }} + path: catkin_ws/src/lpp + - name: Install newest git version + run: sudo apt update && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + + - name: Install GCC version ${{ matrix.gcc }} + run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }} && gcc --version && g++ --version + + - name: Install catkin tools + run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools + + - name: Install system dependencies + run: sudo apt install -y libgoogle-glog-dev + + - uses: actions/checkout@v4 + name: Checkout mav_sensors + with: + repository: ethz-asl/mav_sensors + submodules: recursive + token: ${{ secrets.PAT }} + path: catkin_ws/src/mav_sensors + + - name: Build mav_sensors + run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash + + + + From 691c80d2e2ca8fc2ec34a3ee5b1466388fa432f4 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:42:46 +0200 Subject: [PATCH 2/7] Move yml file to workflows folder --- .github/{ => workflows}/ubuntu20_04.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/ubuntu20_04.yml (100%) diff --git a/.github/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml similarity index 100% rename from .github/ubuntu20_04.yml rename to .github/workflows/ubuntu20_04.yml From 7ab381213cd2522cffe29a380815c8aa7ede0089 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:46:25 +0200 Subject: [PATCH 3/7] Fix indents --- .github/workflows/ubuntu20_04.yml | 63 ++++++++++++++++--------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml index 9a9f6fd..529ebea 100644 --- a/.github/workflows/ubuntu20_04.yml +++ b/.github/workflows/ubuntu20_04.yml @@ -16,37 +16,38 @@ jobs: matrix: rosdistro: ['noetic'] gcc: ['8', '9', '10'] - container: ros:${{ matrix.rosdistro }}-ros-base-focal - name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }} - steps: - - uses: actions/checkout@v4 - name: Checkout lpp - with: - repository: ethz-asl/lpp - token: ${{ secrets.PAT }} - path: catkin_ws/src/lpp - - name: Install newest git version - run: sudo apt update && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git - - - name: Install GCC version ${{ matrix.gcc }} - run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }} && gcc --version && g++ --version - - - name: Install catkin tools - run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools - - - name: Install system dependencies - run: sudo apt install -y libgoogle-glog-dev - - - uses: actions/checkout@v4 - name: Checkout mav_sensors - with: - repository: ethz-asl/mav_sensors - submodules: recursive - token: ${{ secrets.PAT }} - path: catkin_ws/src/mav_sensors - - - name: Build mav_sensors - run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash + container: ros:${{ matrix.rosdistro }}-ros-base-focal + name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }} + steps: + - uses: actions/checkout@v4 + name: Checkout lpp + with: + repository: ethz-asl/lpp + token: ${{ secrets.PAT }} + path: catkin_ws/src/lpp + + - name: Install newest git version + run: sudo apt update && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + + - name: Install GCC version ${{ matrix.gcc }} + run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }} && gcc --version && g++ --version + + - name: Install catkin tools + run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools + + - name: Install system dependencies + run: sudo apt install -y libgoogle-glog-dev + + - uses: actions/checkout@v4 + name: Checkout mav_sensors + with: + repository: ethz-asl/mav_sensors + submodules: recursive + token: ${{ secrets.PAT }} + path: catkin_ws/src/mav_sensors + + - name: Build mav_sensors + run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash From cf94d40ff99ea3758c049c364f8d1613495b01bd Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:49:47 +0200 Subject: [PATCH 4/7] Use bash in build step and set working directory --- .github/workflows/ubuntu20_04.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml index 529ebea..590bc3c 100644 --- a/.github/workflows/ubuntu20_04.yml +++ b/.github/workflows/ubuntu20_04.yml @@ -48,7 +48,8 @@ jobs: - name: Build mav_sensors run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash - + shell: bash + working-directory: catkin_ws From e240f7738645b29c6b2158eba46b44e9867f4919 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:51:56 +0200 Subject: [PATCH 5/7] Fix package name --- .github/workflows/ubuntu20_04.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml index 590bc3c..fce4c9e 100644 --- a/.github/workflows/ubuntu20_04.yml +++ b/.github/workflows/ubuntu20_04.yml @@ -47,7 +47,7 @@ jobs: path: catkin_ws/src/mav_sensors - name: Build mav_sensors - run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash + run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build mav_sensors_demo && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash shell: bash working-directory: catkin_ws From 969ab9cf629c9537d2b7d14706395b1a26719ad0 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:55:03 +0200 Subject: [PATCH 6/7] Fix matrix build name --- .github/workflows/ubuntu20_04.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml index fce4c9e..3c91d49 100644 --- a/.github/workflows/ubuntu20_04.yml +++ b/.github/workflows/ubuntu20_04.yml @@ -17,7 +17,7 @@ jobs: rosdistro: ['noetic'] gcc: ['8', '9', '10'] container: ros:${{ matrix.rosdistro }}-ros-base-focal - name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }} + name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} steps: - uses: actions/checkout@v4 name: Checkout lpp From 1a60562d9a3833b186b80e635b5ee421bfe7a6fa Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:56:18 +0200 Subject: [PATCH 7/7] Remove feature/ci branch in workflow --- .github/workflows/ubuntu20_04.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ubuntu20_04.yml b/.github/workflows/ubuntu20_04.yml index 3c91d49..df2bb4e 100644 --- a/.github/workflows/ubuntu20_04.yml +++ b/.github/workflows/ubuntu20_04.yml @@ -6,7 +6,6 @@ on: push: branches: - "master" - - "feature/ci" jobs: build: