Simplify CI flow, descriptive testing & cpp17 only builds

Summary:
related to T13434

coroutine examples do not compile (https://github.com/ksimicevic/async-mqtt5/actions/runs/7445396892/job/20253559020)

in progress: coverage

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Differential Revision: https://repo.mireo.local/D27261
This commit is contained in:
Korina Šimičević
2024-01-08 15:38:41 +01:00
parent 9ada50dd66
commit 1996251253

View File

@@ -9,6 +9,7 @@ env:
jobs: jobs:
posix: posix:
name: "${{ matrix.toolset }} std=c++${{ matrix.cxxstd }} ${{ matrix.build-type }}" name: "${{ matrix.toolset }} std=c++${{ matrix.cxxstd }} ${{ matrix.build-type }}"
defaults: defaults:
run: run:
shell: bash shell: bash
@@ -17,14 +18,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: g++-11 - toolset: g++-10
compiler: g++-11 compiler: g++-10
install: g++-11 install: g++-10
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:22.04 container: ubuntu:22.04
cxxstd: '17'
build-type: 'Release' build-type: 'Release'
cxxflags: '-Wall -Wextra' cxxstd: 17
cxxflags: ''
ldflags: '' ldflags: ''
- toolset: g++-12 - toolset: g++-12
@@ -32,9 +33,9 @@ jobs:
install: g++-12 install: g++-12
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:22.04 container: ubuntu:22.04
cxxstd: '20'
build-type: 'Release' build-type: 'Release'
cxxflags: '-Wall -Wextra' cxxstd: 17
cxxflags: ''
ldflags: '' ldflags: ''
- toolset: clang++-12 - toolset: clang++-12
@@ -42,9 +43,9 @@ jobs:
install: clang++-12 install: clang++-12
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:22.04 container: ubuntu:22.04
cxxstd: '17'
build-type: 'Release' build-type: 'Release'
cxxflags: '-Wall -Wextra -fdeclspec' cxxstd: 17
cxxflags: '-fdeclspec'
ldflags: '' ldflags: ''
- toolset: clang++-14-libc++-14 - toolset: clang++-14-libc++-14
@@ -52,19 +53,9 @@ jobs:
install: 'clang++-14 libc++-14-dev libc++abi-14-dev' install: 'clang++-14 libc++-14-dev libc++abi-14-dev'
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:22.04 container: ubuntu:22.04
cxxstd: '17'
build-type: 'Release' build-type: 'Release'
cxxflags: '-Wall -Wextra -stdlib=libc++' cxxstd: 17
ldflags: '-lc++' cxxflags: '-stdlib=libc++'
- toolset: clang++-14-libc++-14
compiler: clang++-14
install: 'clang++-14 libc++-14-dev libc++abi-14-dev'
os: ubuntu-latest
container: ubuntu:22.04
cxxstd: '20'
build-type: 'Release'
cxxflags: '-Wall -Wextra -stdlib=libc++'
ldflags: '-lc++' ldflags: '-lc++'
- toolset: clang++-15 - toolset: clang++-15
@@ -72,16 +63,16 @@ jobs:
install: clang++-15 install: clang++-15
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:22.04 container: ubuntu:22.04
cxxstd: '20'
build-type: 'Release' build-type: 'Release'
cxxflags: '-Wall -Wextra -fdeclspec' cxxstd: 17
cxxflags: '-fdeclspec'
ldflags: '' ldflags: ''
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
container: ${{matrix.container}} container: ${{ matrix.container }}
env: env:
CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra CXXFLAGS: ${{ matrix.cxxflags }} -Wall -Wextra -std=c++17
LDFLAGS: ${{matrix.ldflags}} LDFLAGS: ${{ matrix.ldflags }}
CMAKE_BUILD_PARALLEL_LEVEL: 4 CMAKE_BUILD_PARALLEL_LEVEL: 4
steps: steps:
@@ -98,36 +89,27 @@ jobs:
run: sudo apt-get install -y ${{ matrix.install }} run: sudo apt-get install -y ${{ matrix.install }}
- name: Install Boost - name: Install Boost
uses: MarkusJx/install-boost@v2.4.1 uses: MarkusJx/install-boost@v2.4.4
id: install-boost id: install-boost
with: with:
boost_version: 1.82.0 boost_version: 1.82.0
platform_version: 22.04 platform_version: 22.04
# try header only instead of using prebuilt binaries - name: Setup library
# - name: Download Boost
# run: |
# wget https://boostorg.jfrog.io/artifactory/main/release/${{env.BOOST_VERSION}}/source/boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz
# tar xzf boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz
# mkdir boost
# mv boost_${{env.BOOST_DIR_VER_NAME}}/boost boost
# rm -rf boost_${{env.BOOST_DIR_VER_NAME}} boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz
- name: Run CMake
run: | run: |
cmake -S . -B build/${{matrix.compiler}} \ cmake -S . -B build/${{ matrix.compiler }} -DCMAKE_CXX_COMPILER="${{ matrix.compiler }}"
-DCMAKE_CXX_COMPILER="${{matrix.compiler}}" -DCMAKE_CXX_FLAGS="${{env.CXXFLAGS}}" -DCMAKE_PREFIX_PATH="build/${{matrix.compiler}}" sudo cmake --install build/${{ matrix.compiler }}
sudo cmake --install build/${{matrix.compiler}}
env: env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}} BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build tests - name: Build tests
run: | run: |
cmake -S test/unit -B test/unit/build/${{matrix.compiler}} \ cmake -S test/unit -B test/unit/build/${{ matrix.compiler }} \
-DCMAKE_CXX_COMPILER="${{matrix.compiler}}" -DCMAKE_CXX_FLAGS="${{env.CXXFLAGS}}" -DCMAKE_PREFIX_PATH="test/unit/build/${{matrix.compiler}}" -DCMAKE_CXX_COMPILER="${{ matrix.compiler }}" -DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" \
cmake --build test/unit/build/${{matrix.compiler}} -DCMAKE_EXE_LINKER_FLAGS="${{ env.LDFLAGS }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-type }}"
cmake --build test/unit/build/${{ matrix.compiler }}
env: env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}} BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Run tests - name: Run tests
run: ctest --test-dir test/unit/build/${{matrix.compiler}} --output-on-failure --no-tests=error run: ./test/unit/build/${{ matrix.compiler }}/mqtt-test --log_level=test_suite