name: asio CI
on:
push:
branches: [ master, citest-* ]
jobs:
build:
strategy:
fail-fast: false
matrix:
build-type: ['sanity']
runs-on: [ubuntu-22.04, ubuntu-24.04, macos-latest]
compiler: [g++-9, g++-10, g++-12, g++-14, clang++-14, clang++-18, g++]
cxx-std: ['c++11', 'c++14', 'c++17', 'c++2a', 'c++20']
separate-compilation: ['', '--enable-separate-compilation']
optim-level: ['-O0']
no-deprecated: ['']
select-reactor: ['', '-DASIO_DISABLE_EPOLL', '-DASIO_DISABLE_KQUEUE']
handler-tracking: ['']
boost: ['']
boost-url: ['']
exclude:
- runs-on: ubuntu-22.04
compiler: g++-14
- runs-on: ubuntu-22.04
compiler: clang++-18
- runs-on: ubuntu-24.04
compiler: g++-9
- runs-on: ubuntu-24.04
compiler: g++-10
- runs-on: ubuntu-24.04
compiler: clang++-14
- runs-on: ubuntu-22.04
compiler: g++
- runs-on: ubuntu-24.04
compiler: g++
- runs-on: macos-latest
compiler: g++-9
- runs-on: macos-latest
compiler: g++-10
- runs-on: macos-latest
compiler: g++-12
- runs-on: macos-latest
compiler: g++-14
- runs-on: macos-latest
compiler: clang++-14
- runs-on: macos-latest
compiler: clang++-18
- compiler: g++-9
cxx-std: c++20
- compiler: g++-10
cxx-std: c++2a
- compiler: g++-12
cxx-std: c++2a
- compiler: clang++-14
cxx-std: c++20
- compiler: clang++-14
cxx-std: c++2a
- runs-on: macos-latest
cxx-std: c++20
- runs-on: ubuntu-22.04
select-reactor: -DASIO_DISABLE_KQUEUE
- runs-on: ubuntu-24.04
select-reactor: -DASIO_DISABLE_KQUEUE
- runs-on: macos-latest
select-reactor: -DASIO_DISABLE_EPOLL
- compiler: g++-9
separate-compilation: --enable-separate-compilation
- compiler: g++-10
separate-compilation: --enable-separate-compilation
- compiler: g++-11
separate-compilation: --enable-separate-compilation
- runs-on: macos-latest
cxx-std: c++14
separate-compilation: --enable-separate-compilation
- runs-on: macos-latest
cxx-std: c++17
separate-compilation: --enable-separate-compilation
- compiler: g++-9
select-reactor: -DASIO_DISABLE_EPOLL
- compiler: g++-10
select-reactor: -DASIO_DISABLE_EPOLL
- compiler: g++-12
select-reactor: -DASIO_DISABLE_EPOLL
include:
- build-type: full
runs-on: ubuntu-24.04
compiler: g++-12
cxx-std: c++20 -fcoroutines
optim-level: -O2
- build-type: full
runs-on: ubuntu-24.04
compiler: g++-12
cxx-std: c++17
optim-level: -O2
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_76_0
boost-url: https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
optim-level: -O2
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
optim-level: -O0
handler-tracking: -DASIO_ENABLE_HANDLER_TRACKING
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
optim-level: -O0
select-reactor: -DASIO_DISABLE_EPOLL
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
separate-compilation: --enable-separate-compilation
optim-level: -O0
handler-tracking: -DASIO_ENABLE_HANDLER_TRACKING
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
separate-compilation: --enable-separate-compilation
optim-level: -O0
select-reactor: -DASIO_DISABLE_EPOLL
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
optim-level: -O2
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
optim-level: -O0
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
select-reactor: -DASIO_DISABLE_EPOLL
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-10
cxx-std: c++14
separate-compilation: --enable-separate-compilation
optim-level: -O0
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-9
cxx-std: c++11
optim-level: -O2
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-9
cxx-std: c++11
separate-compilation: --enable-separate-compilation
optim-level: -O0
- build-type: full
runs-on: ubuntu-22.04
compiler: g++-9
cxx-std: c++11
separate-compilation: --enable-separate-compilation
optim-level: -O2
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
- build-type: full
runs-on: ubuntu-22.04
compiler: clang++-14
cxx-std: c++2a
optim-level: -O2
- build-type: full
runs-on: ubuntu-22.04
compiler: clang++-14
cxx-std: c++11
separate-compilation: --enable-separate-compilation
optim-level: -O0
- build-type: full
runs-on: ubuntu-24.04
compiler: clang++-18
cxx-std: c++20
separate-compilation: --enable-separate-compilation
optim-level: -O2
- build-type: full
runs-on: ubuntu-22.04
compiler: clang++-14
cxx-std: c++11
optim-level: -O2
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++2a -fcoroutines-ts
optim-level: -O2
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++11
optim-level: -O2
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++11
optim-level: -O0
select-reactor: -DASIO_DISABLE_KQUEUE
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++11
separate-compilation: --enable-separate-compilation
optim-level: -O0
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++11
optim-level: -O2
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
- build-type: full
runs-on: macos-latest
compiler: g++
cxx-std: c++11
separate-compilation: --enable-separate-compilation
optim-level: -O0
with-boost: --with-boost=$GITHUB_WORKSPACE/boost_1_83_0
boost-url: https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2
runs-on: ${{ matrix.runs-on }}
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: -std=${{ matrix.cxx-std }} ${{ matrix.cxx-stdlib }} ${{ matrix.optim-level }} -Wall -Wextra ${{ matrix.no-deprecated }} ${{ matrix.select-reactor }} ${{ matrix.handler-tracking }}
steps:
- uses: actions/checkout@v4
- name: Install autotools
if: startsWith(matrix.runs-on, 'macos')
run: brew install automake
- name: Install compiler
if: startsWith(matrix.runs-on, 'ubuntu')
run: sudo apt-get install -y ${{ matrix.compiler }}
- name: Install boost
if: startsWith(matrix.with-boost, '--with-boost=$GITHUB_WORKSPACE')
run: |
wget --quiet -O - ${{ matrix.boost-url }} | tar -xj
- name: Configure
working-directory: asio
run: |
./autogen.sh
./configure ${{ matrix.separate-compilation }} ${{ matrix.with-boost }}
- name: Line length check
working-directory: asio
run: perl ./boostify.pl --includes-only
- name: Sanity check
if: startsWith(matrix.build-type, 'sanity')
working-directory: asio/src/tests
run: make unit/io_context.log unit/ip/tcp.log unit/ts/net.log
- name: Build
if: startsWith(matrix.build-type, 'full')
working-directory: asio
run: make && make check