Skip to content

Commit 1a9e0fb

Browse files
authored
Merge pull request #33 from ethz-asl/feature/new_docker
Use custom docker container to decrease build time
2 parents a5e803d + f2b44c6 commit 1a9e0fb

File tree

4 files changed

+46
-59
lines changed

4 files changed

+46
-59
lines changed

.github/workflows/coverage_report.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
rosdistro: ['noetic']
1717
gcc: ['10']
1818
cxx: ['17']
19-
container: ros:${{ matrix.rosdistro }}-ros-base-focal
19+
container:
20+
image: omavteam/ubuntu-omav-ros:ros-noetic-ros-base
21+
credentials:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_PASSWORD }}
2024
steps:
2125
- uses: actions/checkout@v3
2226
name: Checkout lpp
@@ -25,20 +29,8 @@ jobs:
2529
token: ${{ secrets.PAT }}
2630
path: catkin_ws/src/lpp
2731

28-
- name: Install newest git version
29-
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
30-
31-
- name: Install GCC version ${{ matrix.gcc }}
32-
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -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 }}
33-
34-
- name: Install catkin tools
35-
run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools
36-
37-
- name: Install system dependencies
38-
run: sudo apt install -y libgoogle-glog-dev
39-
4032
- name: Install gcovr
41-
run: sudo apt install -y gcovr
33+
run: sudo apt update && sudo apt install -y gcovr
4234

4335
- name: Build lpp
4436
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE="Debug" -DENABLE_COVERAGE=1 -DLPP_BUILD_TESTS=1 && make

.github/workflows/cpp_ubuntu20_04.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,40 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: [self-hosted, linux]
12+
runs-on: [ self-hosted, linux ]
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
rosdistro: ['noetic']
17-
gcc: ['8', '9', '10', '11', '13']
18-
cxx: ['11', '14', '17', '20']
19-
container: ros:${{ matrix.rosdistro }}-ros-base-focal
16+
rosdistro: [ 'noetic' ]
17+
gcc: [ '8', '9', '10', '11', '13' ]
18+
cxx: [ '11', '14', '17', '20' ]
19+
container:
20+
image: omavteam/ubuntu-omav-ros:ros-noetic-ros-base
21+
credentials:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_PASSWORD }}
2024
name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }}
2125
steps:
22-
- uses: actions/checkout@v4
23-
name: Checkout lpp
24-
with:
25-
repository: ethz-asl/lpp
26-
token: ${{ secrets.PAT }}
27-
path: catkin_ws/src/lpp
26+
- uses: actions/checkout@v4
27+
name: Checkout lpp
28+
with:
29+
repository: ethz-asl/lpp
30+
token: ${{ secrets.PAT }}
31+
path: catkin_ws/src/lpp
2832

29-
- name: Install newest git version
30-
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
33+
- name: Switch GCC version
34+
run: |
35+
update-alternatives --set gcc /usr/bin/gcc-${{ matrix.gcc }}
36+
update-alternatives --set g++ /usr/bin/g++-${{ matrix.gcc}}
37+
gcc --version
38+
g++ --version
3139
32-
- name: Install GCC version ${{ matrix.gcc }}
33-
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
40+
- name: Build lpp
41+
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DLPP_BUILD_TESTS=1 lpp && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash
42+
working-directory: catkin_ws
43+
shell: bash
3444

35-
- name: Install catkin tools
36-
run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools
37-
38-
- name: Install system dependencies
39-
run: sudo apt install -y libgoogle-glog-dev
40-
41-
- name: Build lpp
42-
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DLPP_BUILD_TESTS=1 lpp && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash
43-
working-directory: catkin_ws
44-
shell: bash
45-
46-
- name: Run unittests
47-
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash && rosrun lpp test_lpp && rosrun lpp test_glog && rosrun lpp test_lpp_custom && rosrun lpp test_nolog && rosrun lpp test_default && rosrun lpp test_roslog
48-
working-directory: catkin_ws
49-
shell: bash
45+
- name: Run unittests
46+
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash && rosrun lpp test_lpp && rosrun lpp test_glog && rosrun lpp test_lpp_custom && rosrun lpp test_nolog && rosrun lpp test_default && rosrun lpp test_roslog
47+
working-directory: catkin_ws
48+
shell: bash

.github/workflows/deploy_coverage_report.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ jobs:
1717
rosdistro: ['noetic']
1818
gcc: ['10']
1919
cxx: ['17']
20-
container: ros:${{ matrix.rosdistro }}-ros-base-focal
20+
container:
21+
image: omavteam/ubuntu-omav-ros:ros-noetic-ros-base
22+
credentials:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
2125
permissions:
2226
pages: write # to deploy to Pages
2327
id-token: write # to verify the deployment originates from an appropriate source
@@ -29,20 +33,8 @@ jobs:
2933
token: ${{ secrets.PAT }}
3034
path: catkin_ws/src/lpp
3135

32-
- name: Install newest git version
33-
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
34-
35-
- name: Install GCC version ${{ matrix.gcc }}
36-
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -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 }}
37-
38-
- name: Install catkin tools
39-
run: sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools
40-
41-
- name: Install system dependencies
42-
run: sudo apt install -y libgoogle-glog-dev
43-
4436
- name: Install gcovr
45-
run: sudo apt install -y gcovr
37+
run: sudo apt update && sudo apt install -y gcovr
4638

4739
- name: Build lpp
4840
run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE="Debug" -DENABLE_COVERAGE=1 -DLPP_BUILD_TESTS=1 && make

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ endif ()
1111
# Set standard of top level project or C++17
1212
if (NOT DEFINED CMAKE_CXX_STANDARD)
1313
set(CMAKE_CXX_STANDARD 17)
14-
add_definitions(-Wall -Wextra -Wpedantic -Werror -Wno-unknown-pragmas)
14+
if (ENABLE_COVERAGE) # Do not enable -Werror for coverage builds
15+
add_definitions(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas)
16+
else ()
17+
add_definitions(-Wall -Wextra -Wpedantic -Werror -Wno-unknown-pragmas)
18+
endif ()
1519
else ()
1620
set(CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
1721
endif ()

0 commit comments

Comments
 (0)