Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
filters: |
src:
- '.github/workflows/run_test.yml'
- 'include/**/*'
- 'test/**/*'

Expand All @@ -36,22 +37,27 @@ jobs:
version: 2022
build_type: [Release, Debug]
cpp_version: [23, 26]
boost_version: [1.86.0]
boost_version: [1.88.0]
compiler:
- name: GCC
version: 14
executable: g++-14
stdlib: libstdc++
- name: Clang
version: 19
executable: clang++-19
version: 21
executable: clang++-21
stdlib: libc++
cxxflags: -stdlib=libc++
- name: Clang
version: 20
executable: clang++-20
version: 22
executable: clang++-22
stdlib: libc++
cxxflags: -stdlib=libc++
- name: MSVC
version: v142
version: v143
executable: cl
stdlib: MSVC-STL
cxxflags: /EHsc
exclude:
- os:
name: windows
Expand Down Expand Up @@ -80,7 +86,8 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{ matrix.compiler.version }} all
sudo ./llvm.sh ${{ matrix.compiler.version }}
sudo apt-get install -y libc++-${{ matrix.compiler.version }}-dev libc++abi-${{ matrix.compiler.version }}-dev

- name: Setup GCC
if: matrix.compiler.name == 'GCC'
Expand All @@ -95,7 +102,7 @@ jobs:
id: cache-boost
with:
path: ${{ github.workspace }}/boost/dist
key: boost-${{ matrix.boost_version }}-${{ matrix.os.name }}-${{ matrix.compiler.executable }}-${{ matrix.cpp_version }}
key: boost-${{ matrix.boost_version }}-${{ matrix.os.name }}-${{ matrix.compiler.name }}-${{ matrix.compiler.version }}-${{ matrix.compiler.stdlib }}-${{ matrix.cpp_version }}

- name: Clone Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -130,18 +137,19 @@ jobs:
working-directory: ${{ github.workspace }}/boost
run: |
cmake -Bbuild -S. ${{ env.cmake_options }} -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j --config Debug
cmake --build build -j4 --config Debug
cmake --install build --prefix dist --config Debug
cmake -Bbuild -S. ${{ env.cmake_options }} -DCMAKE_BUILD_TYPE=Release
cmake --build build -j --config Release
cmake --build build -j4 --config Release
cmake --install build --prefix dist --config Release

- name: Configure
run: >
cmake -B ${{ github.workspace }}/build
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.executable }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_FLAGS=${{ matrix.compiler.cxxflags }}
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/boost/dist
-S ${{ github.workspace }}

Expand All @@ -150,12 +158,12 @@ jobs:
shell: bash
run: |
set -o pipefail
cmake --build ${{ github.workspace }}/build --verbose --config ${{ matrix.build_type }} --target yk_util_test 2>&1 | tee -a compilation.log
cmake --build ${{ github.workspace }}/build -j4 --verbose --config ${{ matrix.build_type }} --target yk_util_test 2>&1 | tee -a compilation.log

- name: Build (Windows)
if: matrix.os.name == 'windows'
run: |
cmake --build ${{ github.workspace }}/build/test --verbose --config ${{ matrix.build_type }} --target yk_util_test 2>&1 | tee -a compilation.log
cmake --build ${{ github.workspace }}/build/test -j4 --verbose --config ${{ matrix.build_type }} --target yk_util_test 2>&1 | tee -a compilation.log

- name: Test (Ubuntu)
if: matrix.os.name == 'ubuntu'
Expand Down
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if(BUILD_TESTING)
PRIVATE ${YK_COMMON_FLAG}
PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -pedantic-errors>
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -pedantic-errors>
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/W4 /permissive- /Zc:__cplusplus /Zc:preprocessor /sdl /utf-8>
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/W4 /permissive- /EHsc /Zc:__cplusplus /Zc:preprocessor /sdl /utf-8>
)
if(MSVC)
target_compile_options(
Expand All @@ -62,10 +62,10 @@ if(BUILD_TESTING)
target_link_libraries(yk_util_test PRIVATE TBB::tbb)
endif()

find_package(Boost REQUIRED CONFIG COMPONENTS unit_test_framework)
find_package(Boost REQUIRED CONFIG COMPONENTS unit_test_framework exception)
target_link_libraries(
yk_util_test PUBLIC yk_util Boost::headers
$<$<NOT:$<CXX_COMPILER_ID:Clang>>:Boost::unit_test_framework>
$<$<NOT:$<CXX_COMPILER_ID:Clang>>:Boost::unit_test_framework> Boost::exception
)
add_test(NAME yk_util_test COMMAND yk_util_test)
endif()