Make tests Wsign-compare correct (#44) #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request, release] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: linux-x64-gcc-7, | |
os: ubuntu-18.04, | |
cxx: g++-7, | |
cmake-build-type: Release | |
} | |
- { | |
name: linux-x64-gcc-7-no-exceptions, | |
os: ubuntu-18.04, | |
cxx: g++-7, | |
cxx-flags: -fno-exceptions, | |
cmake-build-type: Release | |
} | |
- { | |
name: linux-x64-clang-9, | |
os: ubuntu-18.04, | |
cxx: clang++-9, | |
cmake-build-type: Release | |
} | |
- { | |
name: macos-x64-gcc, | |
os: macos-10.15, | |
cxx: g++, | |
cmake-build-type: Release | |
} | |
- { | |
name: macos-x64-clang, | |
os: macos-10.15, | |
cxx: clang++, | |
cmake-build-type: Release | |
} | |
- { | |
name: linux-x64-clang-12-sanitize, | |
os: ubuntu-20.04, | |
cxx: clang++-12, | |
cxx-flags: "-fsanitize=address,undefined", | |
cmake-build-type: Release | |
} | |
- { | |
name: linux-x64-gcc-10-coverage, | |
os: ubuntu-20.04, | |
cxx: g++-10, | |
cxx-flags: --coverage, | |
gcov-tool: gcov-10, | |
cmake-build-type: Debug | |
} | |
- { | |
name: windows-x64-vs-2019, | |
os: windows-2019, | |
cmake-build-type: Release, | |
cmake-generator: Visual Studio 16 2019, | |
cmake-platform: x64, | |
vcpkg-triplet: x64-windows-static-md | |
} | |
- { | |
name: windows-x86-vs-2019, | |
os: windows-2019, | |
cmake-build-type: Release, | |
cmake-generator: Visual Studio 16 2019, | |
cmake-platform: Win32, | |
vcpkg-triplet: x86-windows-static-md | |
} | |
- { | |
name: windows-x64-vs-2022, | |
os: windows-2022, | |
cmake-build-type: Release, | |
cmake-generator: Visual Studio 17 2022, | |
cmake-platform: x64, | |
vcpkg-triplet: x64-windows-static-md | |
} | |
- { | |
name: windows-x86-vs-2022, | |
os: windows-2022, | |
cmake-build-type: Release, | |
cmake-generator: Visual Studio 17 2022, | |
cmake-platform: Win32, | |
vcpkg-triplet: x86-windows-static-md | |
} | |
name: ${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
steps: | |
- uses: actions/checkout@v2 | |
# Windows | |
- name: Install boost (Windows) | |
run: vcpkg install boost-test:${{matrix.config.vcpkg-triplet}} | |
if: runner.os == 'Windows' | |
- name: Configure CMake (Windows) | |
run: cmake -G "${{matrix.config.cmake-generator}}" -A ${{matrix.config.cmake-platform}} -DCMAKE_BUILD_TYPE=${{matrix.config.cmake-build-type}} -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{matrix.config.vcpkg-triplet}} -S ${{github.workspace}}/tests -B ${{github.workspace}}/build | |
if: runner.os == 'Windows' | |
- name: Build (Windows) | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.config.cmake-build-type}} --verbose | |
if: runner.os == 'Windows' | |
- name: Test (Windows) | |
run: ${{github.workspace}}/build/${{matrix.config.cmake-build-type}}/tsl_ordered_map_tests.exe | |
if: runner.os == 'Windows' | |
# Linux or macOS | |
- name: Install boost (Linux or macOS) | |
run: vcpkg install boost-test | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
- name: Configure CMake (Linux or macOS) | |
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.config.cmake-build-type}} -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -S ${{github.workspace}}/tests -B ${{github.workspace}}/build | |
env: | |
CXX: ${{matrix.config.cxx}} | |
CXXFLAGS: ${{matrix.config.cxx-flags}} | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
- name: Build (Linux or macOS) | |
run: cmake --build ${{github.workspace}}/build --verbose | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
- name: Test (Linux or macOS) | |
run: ${{github.workspace}}/build/tsl_ordered_map_tests | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
- name: Coverage | |
run: | | |
sudo apt-get install -y lcov | |
lcov -c -b ${{github.workspace}}/include -d ${{github.workspace}}/build -o ${{github.workspace}}/coverage.info --no-external --gcov-tool ${{matrix.config.gcov-tool}} | |
bash <(curl -s https://codecov.io/bash) -f ${{github.workspace}}/coverage.info | |
if: ${{matrix.config.name == 'linux-x64-gcc-10-coverage'}} |