Skip to content

Make constructor from arguments (one without std::in_place) non-`ex… #1050

Make constructor from arguments (one without std::in_place) non-`ex…

Make constructor from arguments (one without std::in_place) non-`ex… #1050

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
jobs:
linux:
name: 'Linux ${{matrix.name}}'
runs-on: ${{matrix.os}}
env:
CMAKE_GENERATOR: 'Ninja Multi-Config'
VERBOSE: 1
CXX: ${{matrix.cxx}}
CC: ${{matrix.cc}}
CXXFLAGS: ${{matrix.global_cxx_options}}
ASAN_OPTIONS: 'detect_invalid_pointer_pairs=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true:${{matrix.asan_options}}'
UBSAN_OPTIONS: 'print_stacktrace=1:silence_unsigned_overflow=1'
strategy:
fail-fast: false
matrix:
include:
- name: 'clang 18 C++20'
cxx: 'clang++-18'
cc: 'clang-18'
packages: 'llvm-18 g++-multilib'
os: 'ubuntu-24.04'
x64_options: >-
-fsanitize=undefined,object-size
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
cmake_options: -DCMAKE_CXX_STANDARD=20
- name: 'clang 18'
cxx: 'clang++-18'
cc: 'clang-18'
packages: 'llvm-18 g++-multilib'
os: 'ubuntu-24.04'
x64_options: >-
-fsanitize=undefined,object-size
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
# install-llvm: { version: '18.1.8', url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz' }
- name: 'clang 17'
cxx: 'clang++-17'
cc: 'clang-17'
packages: 'llvm-17 g++-multilib'
os: 'ubuntu-24.04'
options: '--stdlib=libstdc++'
x64_options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
# install-llvm: { version: '17.0.6', url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz' }
- name: 'clang 16'
cxx: 'clang++-16'
cc: 'clang-16'
packages: 'llvm-16 g++-multilib'
os: 'ubuntu-24.04'
x64_options: >-
-fsanitize=undefined,object-size
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
# install-llvm: { version: '16.0.4', url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.4/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz' }
- name: 'clang 15'
cxx: 'clang++-15'
cc: 'clang-15'
packages: 'llvm-15 libclang-15-dev llvm-15-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 14'
cxx: 'clang++-14'
cc: 'clang-14'
packages: 'llvm-14 libclang-14-dev llvm-14-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 13'
cxx: 'clang++-13'
cc: 'clang-13'
packages: 'llvm-13 libclang-13-dev llvm-13-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
x64_options: '-fsanitize=undefined'
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 12'
cxx: 'clang++-12'
cc: 'clang-12'
packages: 'llvm-12 clang-12 libclang-12-dev llvm-12-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
-Wno-unknown-warning-option
--stdlib=libstdc++
x64_options: '-fsanitize=undefined'
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 11'
cxx: 'clang++-11'
cc: 'clang-11'
packages: 'llvm-11 clang-11 libclang-11-dev llvm-11-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
x64_options: '-fsanitize=undefined'
asan_options: 'use_sigaltstack=false'
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 10'
cxx: 'clang++-10'
cc: 'clang-10'
packages: 'llvm-10 clang-10 libclang-10-dev llvm-10-dev g++-multilib'
os: 'ubuntu-20.04'
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
-ffp-exception-behavior=maytrap
--stdlib=libstdc++
x64_options: '-fsanitize=undefined'
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'clang 9'
cxx: 'clang++-9'
cc: 'clang-9'
packages: 'llvm-9 clang-9 libclang-9-dev llvm-9-dev g++-multilib'
os: 'ubuntu-20.04'
options: >-
-fsanitize=address,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
--stdlib=libstdc++
x64_options: '-fsanitize=undefined'
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'gcc 14 C++20'
cxx: 'g++-14'
cc: 'gcc-14'
os: 'ubuntu-24.04'
packages: 'llvm-18 g++-14-multilib'
x64_options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
cmake_options: -DCMAKE_CXX_STANDARD=20
- name: 'gcc 14'
cxx: 'g++-14'
cc: 'gcc-14'
os: 'ubuntu-24.04'
packages: 'llvm-18 g++-14-multilib'
x64_options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
- name: 'gcc 13'
cxx: 'g++-13'
cc: 'gcc-13'
os: 'ubuntu-24.04'
packages: 'llvm-18 g++-13-multilib'
options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
disable_codegen_test: 'true' # broken version?
- name: 'gcc 12'
cxx: 'g++-12'
cc: 'gcc-12'
os: 'ubuntu-22.04'
packages: 'llvm-15 g++-12-multilib'
options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'gcc 11'
cxx: 'g++-11'
cc: 'gcc-11'
os: 'ubuntu-22.04'
packages: 'llvm-15 g++-11-multilib'
options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'gcc 10'
cxx: 'g++-10'
cc: 'gcc-10'
os: 'ubuntu-22.04'
packages: 'llvm-15 g++-10-multilib'
options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
- name: 'gcc 9'
cxx: 'g++-9'
cc: 'gcc-9'
os: 'ubuntu-22.04'
packages: 'llvm-15 g++-9-multilib'
options: >-
-fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
-fno-sanitize-recover=all
-fno-sanitize=vptr
-Wno-unused-value
cmake_options: '-DOLD_LIBSTDCPP=TRUE'
# - name: 'gcc 10'
# cxx: 'g++-10'
# cc: 'gcc-10'
# packages: 'g++-10'
# os: 'ubuntu-22.04'
# options: >-
# -fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
# -fno-sanitize-recover=all
# -fno-sanitize=vptr
#
# - name: 'gcc 9'
# cxx: 'g++-9'
# cc: 'gcc-9'
# packages: 'g++-9'
# os: 'ubuntu-22.04'
# options: >-
# -fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
# -fno-sanitize-recover=all
# -fno-sanitize=vptr
# -Wno-error=extra
# - cxx: 'g++-8', cc: 'gcc-8', packages: 'g++-8', os: 'ubuntu-20.04',
# options: '
# -fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum,pointer-overflow,builtin
# -fno-sanitize-recover=all
# -fno-sanitize=vptr'
# }
# - { cxx: 'g++-7', cc: 'gcc-7', packages: 'g++-7', os: 'ubuntu-20.04',
# options: '
# -fsanitize=address,undefined,alignment,bool,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,null,return,bounds,bounds-strict,object-size,float-divide-by-zero,float-cast-overflow,enum
# -fno-sanitize-recover=all
# -fno-sanitize=vptr',
# cmake_options: '-DUSE_LIBASSERT=FALSE'
# }
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ninja-build ${{matrix.packages}}
# - name: Install LLVM
# if: ${{matrix.install-llvm}}
# uses: KyleMayes/install-llvm-action@v2.0.3
# with:
# version: ${{matrix.install-llvm.version}}
# force-url: ${{matrix.install-llvm.url}}
- name: Configure CMake
run: >-
cmake -B build
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE
-DCMAKE_CXX_EXTENSIONS=FALSE
"-DOPTION_EXTRA_FLAGS=${{matrix.options}} ${{matrix.x64_options}}"
${{matrix.cmake_options}}
- name: Build (Debug)
run: cmake --build build --config Debug --parallel `nproc`
- name: Run tests (Debug)
run: cmake --build build --config Debug --target run-option-test
- name: Check examples (Debug)
run: cmake --build build --config Debug --target check-option-examples
- name: Build (Release)
run: cmake --build build --config Release --parallel `nproc`
- name: Run tests (Release)
run: cmake --build build --config Release --target run-option-test
- name: Check examples (Release)
run: cmake --build build --config Release --target check-option-examples
- name: Run codegen tests
if: matrix.disable_codegen_test != 'true'
run: |
dpkg -l libstdc++6 | grep libstd
cmake --build build --config Release --target run-option-codegen-test
- name: Configure CMake (x32)
env:
CXXFLAGS: -m32 ${{matrix.global_cxx_options}}
CFLAGS: -m32
run: >-
cmake -B build-x32
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE
-DCMAKE_CXX_EXTENSIONS=FALSE
"-DOPTION_EXTRA_FLAGS=${{matrix.options}} ${{matrix.x32_options}}"
${{matrix.cmake_options}}
- name: Build (Debug x32)
run: cmake --build build-x32 --config Debug --parallel `nproc`
- name: Run tests (Debug x32)
run: cmake --build build-x32 --config Debug --target run-option-test
- name: Check examples (Debug x32)
run: cmake --build build-x32 --config Debug --target check-option-examples
- name: Build (Release x32)
run: cmake --build build-x32 --config Release --parallel `nproc`
- name: Run tests (Release x32)
run: cmake --build build-x32 --config Release --target run-option-test
- name: Check examples (Release x32)
run: cmake --build build-x32 --config Release --target check-option-examples
linux-libcpp:
name: 'Linux ${{matrix.name}} libc++'
runs-on: ${{matrix.os}}
env:
CMAKE_GENERATOR: 'Ninja Multi-Config'
VERBOSE: 1
CXX: ${{matrix.cxx}}
CC: ${{matrix.cc}}
CXXFLAGS: '--stdlib=libc++'
ASAN_OPTIONS: 'detect_invalid_pointer_pairs=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true:${{matrix.asan_options}}'
UBSAN_OPTIONS: 'print_stacktrace=1:silence_unsigned_overflow=1'
strategy:
fail-fast: false
matrix:
include:
- name: 'clang 18'
cxx: 'clang++-18'
cc: 'clang-18'
packages: 'libc++-18-dev libc++abi-18-dev g++-multilib'
os: 'ubuntu-24.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 17'
cxx: 'clang++-17'
cc: 'clang-17'
packages: 'libc++-17-dev libc++abi-17-dev g++-multilib'
os: 'ubuntu-24.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 16'
cxx: 'clang++-16'
cc: 'clang-16'
packages: 'libc++-16-dev libc++abi-16-dev g++-multilib'
os: 'ubuntu-24.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 15'
cxx: 'clang++-15'
cc: 'clang-15'
packages: 'libc++-15-dev libc++abi-15-dev libclang-15-dev llvm-15-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 14'
cxx: 'clang++-14'
cc: 'clang-14'
packages: 'libc++-14-dev libc++abi-14-dev libclang-14-dev llvm-14-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 13'
cxx: 'clang++-13'
cc: 'clang-13'
packages: 'libc++-13-dev libc++abi-13-dev libclang-13-dev llvm-13-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
- name: 'clang 12'
cxx: 'clang++-12'
cc: 'clang-12'
packages: 'clang-12 libunwind-dev libc++-12-dev libc++abi-12-dev libclang-12-dev llvm-12-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-ffp-exception-behavior=maytrap
-Wno-unknown-warning-option
- name: 'clang 11'
cxx: 'clang++-11'
cc: 'clang-11'
packages: 'clang-11 libc++-11-dev libc++abi-11-dev libclang-11-dev llvm-11-dev g++-multilib'
os: 'ubuntu-22.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
-ffp-exception-behavior=maytrap
asan_options: 'use_sigaltstack=false'
- name: 'clang 10'
cxx: 'clang++-10'
cc: 'clang-10'
packages: 'clang-10 libc++-10-dev libc++abi-10-dev libclang-10-dev llvm-10-dev g++-multilib'
os: 'ubuntu-20.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
-ffp-exception-behavior=maytrap
- name: 'clang 9'
cxx: 'clang++-9'
cc: 'clang-9'
packages: 'clang-9 libc++-9-dev libc++abi-9-dev libclang-9-dev llvm-9-dev g++-multilib'
os: 'ubuntu-20.04'
options: >-
-fsanitize=address,undefined,vptr,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable
-fno-sanitize-recover=all
-Wno-unknown-warning-option
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build ${{matrix.packages}}
- name: Configure CMake
run: >-
cmake -B build
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE
-DCMAKE_CXX_EXTENSIONS=FALSE
"-DOPTION_EXTRA_FLAGS=${{matrix.options}}"
${{matrix.cmake_options}}
- name: Build (Debug)
run: cmake --build build --config Debug --parallel `nproc`
- name: Run tests (Debug)
run: cmake --build build --config Debug --target run-option-test
- name: Check examples (Debug)
run: cmake --build build --config Debug --target check-option-examples
- name: Build (Release)
run: cmake --build build --config Release --parallel `nproc`
- name: Run tests (Release)
run: cmake --build build --config Release --target run-option-test
- name: Check examples (Release)
run: cmake --build build --config Release --target check-option-examples
- name: Run codegen tests
run: cmake --build build --config Release --target run-option-codegen-test
windows:
name: 'Windows VS ${{matrix.name}}'
runs-on: ${{matrix.os}}
env:
VERBOSE: 1
ASAN_OPTIONS: 'detect_invalid_pointer_pairs=2:strict_string_checks=true:detect_odr_violation=0:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true'
UBSAN_OPTIONS: 'print_stacktrace=1'
strategy:
fail-fast: false
matrix:
include:
- name: 'v143'
toolset: 'v143'
os: windows-2022
options: '/fsanitize=address /Zi /DEBUG /INCREMENTAL:NO'
- name: 'v143 C++20'
toolset: 'v143'
os: windows-2022
options: '/fsanitize=address /Zi /DEBUG /INCREMENTAL:NO'
cmake_options: -DCMAKE_CXX_STANDARD=20
- name: 'v142'
toolset: 'v142'
os: windows-2019
options: '/Zi /DEBUG /INCREMENTAL:NO'
cmake_options: -DUSE_LIBASSERT=FALSE
- name: 'ClangCL'
toolset: 'ClangCL'
os: windows-2022
options_x64: '-fsanitize=undefined,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable -fno-sanitize-recover=all'
cmake_options_x64: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
"-DCMAKE_EXE_LINKER_FLAGS_INIT=`"$env:ProgramFiles/LLVM/lib/clang/18/lib/windows/clang_rt.asan-x86_64.lib`" `"$env:ProgramFiles/LLVM/lib/clang/18/lib/windows/clang_rt.asan_cxx-x86_64.lib`" clang_rt.ubsan_standalone_cxx-x86_64.lib clang_rt.ubsan_standalone-x86_64.lib"
- name: 'ClangCL C++20'
toolset: 'ClangCL'
os: windows-2022
options_x64: '-fsanitize=undefined,alignment,bool,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift,shift-base,shift-exponent,unreachable -fno-sanitize-recover=all'
cmake_options_x64: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
"-DCMAKE_EXE_LINKER_FLAGS_INIT=`"$env:ProgramFiles/LLVM/lib/clang/18/lib/windows/clang_rt.asan-x86_64.lib`" `"$env:ProgramFiles/LLVM/lib/clang/18/lib/windows/clang_rt.asan_cxx-x86_64.lib`" clang_rt.ubsan_standalone_cxx-x86_64.lib clang_rt.ubsan_standalone-x86_64.lib"
cmake_options: -DCMAKE_CXX_STANDARD=20
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install LLVM
uses: KyleMayes/install-llvm-action@v2.0.3
with:
version: '18.1.8'
force-url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz'
- name: Configure CMake (x64)
run: cmake -B build -A x64 -T "${{matrix.toolset}}" "-DOPTION_EXTRA_FLAGS=${{matrix.options}} ${{matrix.options_x64}}" ${{matrix.cmake_options_x64}} ${{matrix.cmake_options}}
- name: Build (Debug x64)
run: cmake --build build --config Debug --parallel $env:NUMBER_OF_PROCESSORS
- name: Run tests (Debug x64)
run: cmake --build build --config Debug --target run-option-test
- name: Check examples (Debug x64)
run: cmake --build build --config Debug --target check-option-examples
- name: Build (Release x64)
run: cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
- name: Run tests (Release x64)
run: cmake --build build --config Release --target run-option-test
- name: Check examples (Release x64)
run: cmake --build build --config Release --target check-option-examples
- name: Run codegen tests
run: cmake --build build --config Release --target run-option-codegen-test
- name: Configure CMake (x32)
run: cmake -B build-x32 -A Win32 -T "${{matrix.toolset}}" "-DOPTION_EXTRA_FLAGS=${{matrix.options}} ${{matrix.options_x32}}" ${{matrix.cmake_options_x32}} ${{matrix.cmake_options}}
- name: Build (Debug x32)
run: cmake --build build-x32 --config Debug --parallel $env:NUMBER_OF_PROCESSORS
- name: Run tests (Debug x32)
run: cmake --build build-x32 --config Debug --target run-option-test
- name: Check examples (Debug x32)
run: cmake --build build-x32 --config Debug --target check-option-examples
- name: Build (Release x32)
run: cmake --build build-x32 --config Release --parallel $env:NUMBER_OF_PROCESSORS
- name: Run tests (Release x32)
run: cmake --build build-x32 --config Release --target run-option-test
- name: Check examples (Release x32)
run: cmake --build build-x32 --config Release --target check-option-examples
intel-compiler:
name: 'Intel LLVM-based compiler'
runs-on: ubuntu-latest
env:
VERBOSE: 1
CMAKE_GENERATOR: 'Ninja Multi-Config'
CXX: 'icpx'
CC: 'icx'
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Cache Install Intel Compiler
id: cache-icx
uses: actions/cache@v4.0.2
with:
path: /opt/intel/oneapi
key: icx-2023
- name: Install Intel Compiler
if: steps.cache-icx.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
- name: Install Ninja
run: sudo apt-get install ninja-build
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Configure CMake
run: >-
cmake -B build
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE
-DCMAKE_CXX_EXTENSIONS=FALSE
- name: Build (Debug)
run: cmake --build build --config Debug --parallel `nproc`
- name: Run tests (Debug)
run: cmake --build build --config Debug --target run-option-test
- name: Check examples (Debug)
run: cmake --build build --config Debug --target check-option-examples
- name: Build (Release)
run: cmake --build build --config Release --parallel `nproc`
- name: Run tests (Release)
run: cmake --build build --config Release --target run-option-test
- name: Check examples (Release)
run: cmake --build build --config Release --target check-option-examples
- name: Run codegen tests
run: cmake --build build --config Release --target run-option-codegen-test
clang-tidy:
name: 'Clang tidy on ${{matrix.os}} (${{matrix.configuration}})'
runs-on: ${{matrix.os}}
env:
VERBOSE: 1
CMAKE_GENERATOR: Ninja
CXX: clang++
CC: clang
strategy:
fail-fast: false
matrix:
configuration: ['Debug', 'Release']
os: ['ubuntu-22.04', 'windows-latest']
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install LLVM (Linux)
if: matrix.os == 'ubuntu-22.04'
uses: KyleMayes/install-llvm-action@v2.0.3
with:
version: '18.1.8'
force-url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
- name: Install LLVM (Windows)
if: matrix.os == 'windows-latest'
uses: KyleMayes/install-llvm-action@v2.0.3
with:
version: '18.1.8'
force-url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz'
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update && sudo apt-get install ninja-build libncurses5
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
curl -Lo ninja-win-v1-12-1.zip https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip
7z x ninja-win-v1-12-1.zip -oninja-win-v1-12-1
Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE/ninja-win-v1-12-1"
- name: Configure CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.configuration}} -DCMAKE_CXX_EXTENSIONS=FALSE -DUSE_CLANG_TIDY=TRUE
- name: Run clang-tidy
run: cmake --build build --config ${{matrix.configuration}} --target clang-tidy
install-project:
name: 'Install on ${{matrix.name}}'
runs-on: ${{matrix.os}}
env:
VERBOSE: 1
CXX: ${{matrix.cxx}}
CC: ${{matrix.cc}}
CXXFLAGS: ${{matrix.options}}
CFLAGS: ${{matrix.options}}
# CMAKE_BUILD_PARALLEL_LEVEL: ''
strategy:
fail-fast: false
matrix:
include:
- name: 'Linux GCC'
os: 'ubuntu-22.04'
cxx: 'g++'
cc: 'gcc'
options: >-
-Wall -Wextra -Wconversion -Werror -Wpedantic -Wold-style-cast -Wfloat-equal -Wlogical-op -Wundef
-Wredundant-decls -Wshadow -Wwrite-strings -Wpointer-arith -Wcast-qual -Wswitch-default
-Wmissing-include-dirs -Wcast-align -Wswitch-enum -Wctor-dtor-privacy
-Wsign-conversion -Wdisabled-optimization -Weffc++ -Winvalid-pch -Wmissing-declarations
-Woverloaded-virtual -Wunused-but-set-variable -Wunused-result -Wnoexcept -Wdouble-promotion
-Wtrampolines -Wzero-as-null-pointer-constant -Wuseless-cast -Wvector-operation-performance
-Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca -Wduplicated-branches
-Wcast-align -Wunused -Wsign-conversion
- name: 'Linux Clang'
os: 'ubuntu-22.04'
cxx: 'clang++'
cc: 'clang'
options: '-Weverything -Werror'
- name: 'Windows MSVC'
os: 'windows-latest'
options: '/Wall /WX /permissive- /wd5045'
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Configure CMake for installation project (main)
env: { CXXFLAGS: '', CFLAGS: '' }
run: cmake -B build -DOPTION_INSTALL=TRUE
- name: Install project (main)
run: ${{matrix.os == 'ubuntu-22.04' && 'sudo' || ''}} cmake --install build --verbose
- name: Configure CMake (find_package)
run: cmake -B find_package-build -S ./test/cmake/find_package/ -DCMAKE_FIND_DEBUG_MODE=TRUE
- name: Build project (find_package)
run: cmake --build find_package-build
- name: Run executable (find_package)
run: cmake --build find_package-build --target run
- name: Configure CMake (FetchContent)
run: >-
cmake -B FetchContent-build -S ./test/cmake/FetchContent/
-DGIT_REPOSITORY=${{github.server_url}}/${{github.repository}}.git
-DGIT_TAG=${{github.sha}}
-DFETCHCONTENT_QUIET=FALSE
- name: Build project (FetchContent)
run: cmake --build FetchContent-build
- name: Run executable (FetchContent)
run: cmake --build FetchContent-build --target run
- name: Configure CMake (ExternalProject)
run: >-
cmake -B ExternalProject-build -S ./test/cmake/ExternalProject/
-DGIT_REPOSITORY=${{github.server_url}}/${{github.repository}}.git
-DGIT_TAG=${{github.sha}}
- name: Build project (ExternalProject)
run: cmake --build ExternalProject-build
- name: Run executable (ExternalProject)
run: cmake --build ExternalProject-build --target run
- name: Configure CMake (add_subdirectory)
run: cmake -B add_subdirectory-build -S ./test/cmake/add_subdirectory/ "-DROOT=${{github.workspace}}"
- name: Build project (add_subdirectory)
run: cmake --build add_subdirectory-build
- name: Run executable (add_subdirectory)
run: cmake --build add_subdirectory-build --target run