Skip to content

Setup github actions based CI #21

Setup github actions based CI

Setup github actions based CI #21

Workflow file for this run

name: Build
on: push
jobs:
build:
strategy:
matrix:
build_type:
- Release
- Debug
boost_version:
- '1.67'
- '1.74'
compiler:
- g++-7
- g++-11
- clang++-6
- clang++-15
include:
- boost_version: '1.67'
os: ubuntu-20.04
- boost_version: '1.74'
os: ubuntu-22.04
- compiler: g++-7
compiler_package: g++-7
os: ubuntu-20.04
- compiler: g++-11
compiler_package: g++-11
os: ubuntu-22.04
- compiler: clang++-6
compiler_package: clang-6
os: ubuntu-20.04
- compiler: clang++-15
compiler_package: clang-15
os: ubuntu-22.04
name: Build ${{ matrix.build_type }} with ${{ matrix.compiler }} and boost ${{ matrix.boost_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update apt-get
run: sudo apt-get update
- name: Install apt packages for dependencies
run: >
sudo apt-get install -y --no-install-recommends
ccache
cmake
libboost-atomic${{ matrix.boost_version }}-dev
libboost-context${{ matrix.boost_version }}-dev
libboost-coroutine${{ matrix.boost_version }}-dev
libboost-date-time${{ matrix.boost_version }}-dev
libboost-thread${{ matrix.boost_version }}-dev
ninja-build
${{ matrix.compiler_package }}
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}
max-size: 1G
- name: Configure
run: >
cmake
-B build
-S .
-G Ninja
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
-D CMAKE_CXX_COMPILER=${{ matrix.compiler }}
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache
-D RESOURCE_POOL_BUILD_TESTS=ON
-D RESOURCE_POOL_BUILD_EXAMPLES=ON
-D RESOURCE_POOL_BUILD_BENCHMARKS=ON
-D RESOURCE_POOL_USE_SYSTEM_GOOGLETEST=OFF
-D RESOURCE_POOL_USE_SYSTEM_BENCHMARK=OFF
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build
- name: Run tests
run: build/tests/resource_pool_test
- name: Run benchmark
run: build/benchmarks/resource_pool_benchmark_async
- name: Run async_pool example
run: build/examples/async_pool
- name: Run async_strand example
run: build/examples/async_strand
- name: Run coro_pool example
run: build/examples/coro_pool
- name: Run sync_pool example
run: build/examples/sync_pool