Skip to content

Add boost build to ci #50

Add boost build to ci

Add boost build to ci #50

Workflow file for this run

# See runners details:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software
name: CI
on:
push:
branches: ["master", "0.7-dev"]
pull_request:
jobs:
Build-Windows:
# The type of runner that the job will run on
name: ${{ matrix.config.name }} (${{ matrix.build_type }}, ${{ matrix.config.cxx }}, C++${{ matrix.cppstd }})
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows Latest MSVC"
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
os: windows-latest
cc: "cl"
cxx: "cl"
generator: "Visual Studio 17 2022"
build_type:
- Release
- Debug
cppstd:
- 17
- 20
env:
CXX: ${{ matrix.config.cxx }}
RESTINIO_BUILD_DIR: _build_${{ matrix.config.cxx }}_cppstd${{ matrix.cppstd }}_${{ matrix.build_type }}
steps:
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies
run: |
gem install Mxx_ru
- name: Configure
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B $RESTINIO_BUILD_DIR \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [cpp${{ matrix.cppstd }}_${{ matrix.build_type }}]" \
-G "${{ matrix.config.generator }}"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--config ${{ matrix.build_type }} \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
-C ${{ matrix.build_type }} \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output
Build-Linux:
# The type of runner that the job will run on
name: Ubuntu-22.04 (${{ matrix.build_settings.cname }}, ${{ matrix.build_type }}, C++${{ matrix.build_settings.cppstd }}, ${{matrix.build_settings.asio_source}} asio)
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_settings:
- cname: gcc
cxxname: g++
ar: gcc-ar
cversion: 9
cppstd: 17
asio_source: standalone
- cname: gcc-9
cxxname: g++-9
ar: gcc-ar-9
cversion: 9
cppstd: 17
asio_source: boost
- cname: gcc
cxxname: g++
ar: gcc-ar
cversion: 12
cppstd: 17
asio_source: standalone
- cname: gcc
cxxname: g++
ar: gcc-ar
cversion: 12
cppstd: 20
asio_source: standalone
- cname: gcc
cxxname: g++
ar: gcc-ar
cversion: 12
cppstd: 20
asio_source: boost
- cname: clang
cxxname: clang++
ar: llvm-ar
cversion: 13
cppstd: 17
asio_source: standalone
- cname: clang
cxxname: clang++
ar: llvm-ar
cversion: 15
cppstd: 17
asio_source: standalone
- cname: clang
cxxname: clang++
ar: llvm-ar
cversion: 15
cppstd: 20
asio_source: standalone
build_type:
- Release
- Debug
env:
CC: ${{ matrix.build_settings.cname }}-${{ matrix.build_settings.cversion }}
CXX: ${{ matrix.build_settings.cxxname }}-${{ matrix.build_settings.cversion }}
AR: ${{ matrix.build_settings.ar }}-${{ matrix.build_settings.cversion }}
RESTINIO_BUILD_TAG: ${{ matrix.build_settings.cname }}-${{ matrix.build_settings.cversion }}_cpp${{ matrix.build_settings.cppstd }}_${{ matrix.build_type }}_${{matrix.build_settings.asio_source}}_asio
steps:
- uses: actions/checkout@v3
- name: Prepare env
run: |
echo "RESTINIO_BUILD_DIR=_build_${RESTINIO_BUILD_TAG}" >> $GITHUB_ENV
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies
run: |
sudo gem install Mxx_ru
# run: |
# sudo apt-get update && sudo apt-get install -y libboost-all-dev
- name: Configure (standalone ASIO)
if: ${{ matrix.build_settings.asio_source == 'standalone' }}
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.build_settings.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [${RESTINIO_BUILD_TAG}]"
- name: Obtain Boost
if: ${{ matrix.build_settings.asio_source == 'boost' }}
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.83.0
boost_install_dir: ${{github.workspace}}/local_boost
toolset: ${{ matrix.build_settings.cname }}
platform_version: 22.04
- name: Configure (Boost ASIO)
if: ${{ matrix.build_settings.asio_source == 'boost' }}
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.build_settings.cppstd }} \
-DRESTINIO_ASIO_SOURCE=boost \
-DBOOST_ROOT=${{ steps.install-boost.outputs.BOOST_ROOT }} \
-DRESTINIO_TEST_SUFFIX=" [${RESTINIO_BUILD_TAG}]"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output
Build-Macos:
# The type of runner that the job will run on
name: macos-12 (${{ matrix.build_type }}, C++${{ matrix.cppstd }})
runs-on: macos-12
strategy:
fail-fast: false
matrix:
cppstd:
- 17
- 20
build_type:
- Release
- Debug
env:
RESTINIO_BUILD_DIR: _build_cpp${{ matrix.cppstd }}_${{ matrix.build_type }}
steps:
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies
run: |
gem install Mxx_ru
- name: Configure
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [cpp${{ matrix.cppstd }}_${{ matrix.build_type }}]"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output