forked from boostorg/mqtt5
Summary: related to T13434 results: https://github.com/ksimicevic/async-mqtt5/actions/runs/7423093001/job/20199741951 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D27242
134 lines
4.2 KiB
YAML
134 lines
4.2 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
BOOST_VERSION: 1.82.0
|
|
BOOST_DIR_VER_NAME: 1_82_0
|
|
|
|
jobs:
|
|
posix:
|
|
name: "${{ matrix.toolset }} std=c++${{ matrix.cxxstd }} ${{ matrix.build-type }}"
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- toolset: g++-11
|
|
compiler: g++-11
|
|
install: g++-11
|
|
os: ubuntu-latest
|
|
container: ubuntu:22.04
|
|
cxxstd: '17'
|
|
build-type: 'Release'
|
|
cxxflags: '-Wall -Wextra'
|
|
ldflags: ''
|
|
|
|
- toolset: g++-12
|
|
compiler: g++-12
|
|
install: g++-12
|
|
os: ubuntu-latest
|
|
container: ubuntu:22.04
|
|
cxxstd: '20'
|
|
build-type: 'Release'
|
|
cxxflags: '-Wall -Wextra'
|
|
ldflags: ''
|
|
|
|
- toolset: clang++-12
|
|
compiler: clang++-12
|
|
install: clang++-12
|
|
os: ubuntu-latest
|
|
container: ubuntu:22.04
|
|
cxxstd: '17'
|
|
build-type: 'Release'
|
|
cxxflags: '-Wall -Wextra -fdeclspec'
|
|
ldflags: ''
|
|
|
|
- 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: '17'
|
|
build-type: 'Release'
|
|
cxxflags: '-Wall -Wextra -stdlib=libc++'
|
|
ldflags: '-lc++'
|
|
|
|
- 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++'
|
|
|
|
- toolset: clang++-15
|
|
compiler: clang++-15
|
|
install: clang++-15
|
|
os: ubuntu-latest
|
|
container: ubuntu:22.04
|
|
cxxstd: '20'
|
|
build-type: 'Release'
|
|
cxxflags: '-Wall -Wextra -fdeclspec'
|
|
ldflags: ''
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{matrix.container}}
|
|
env:
|
|
CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra
|
|
LDFLAGS: ${{matrix.ldflags}}
|
|
CMAKE_BUILD_PARALLEL_LEVEL: 4
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup container environment
|
|
if: matrix.container
|
|
run: |
|
|
apt-get update
|
|
apt-get -y install sudo wget tar cmake git openssl libssl-dev pkg-config
|
|
|
|
- name: Install compiler
|
|
run: sudo apt-get install -y ${{ matrix.install }}
|
|
|
|
- name: Install Boost
|
|
uses: MarkusJx/install-boost@v2.4.1
|
|
id: install-boost
|
|
with:
|
|
boost_version: 1.82.0
|
|
platform_version: 22.04
|
|
|
|
# try header only instead of using prebuilt binaries
|
|
# - 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: |
|
|
cmake -S . -B build/${{matrix.compiler}} \
|
|
-DCMAKE_CXX_COMPILER="${{matrix.compiler}}" -DCMAKE_CXX_FLAGS="${{env.CXXFLAGS}}" -DCMAKE_PREFIX_PATH="build/${{matrix.compiler}}"
|
|
sudo cmake --install build/${{matrix.compiler}}
|
|
env:
|
|
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
|
|
|
|
- name: Build tests
|
|
run: |
|
|
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}}"
|
|
cmake --build test/unit/build/${{matrix.compiler}}
|
|
env:
|
|
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
|
|
|
|
- name: Run tests
|
|
run: ctest --test-dir test/unit/build/${{matrix.compiler}} --output-on-failure --no-tests=error
|