Add CI, fix ct strings, various clang-tidy fixes #6
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
paths: | |
- '.github/**' | |
- 'cmake/**' | |
- 'src/**' | |
- 'CMakeLists.txt' | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/**' | |
- 'cmake/**' | |
- 'src/**' | |
- 'CMakeLists.txt' | |
jobs: | |
test_cxx: | |
name: ${{ matrix.os }}, ${{ matrix.compiler }}, ${{ matrix.buildtype }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
compiler: [gcc, clang, msvc] | |
buildtype: [Debug, Release] | |
exclude: | |
- os: windows-latest | |
compiler: gcc | |
# This will work, but its kinda slow and doesn't really matter anyways | |
- os: windows-latest | |
compiler: clang | |
- os: ubuntu-latest | |
compiler: msvc | |
env: | |
BUILD_TYPE: ${{ matrix.buildtype }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup clang and libc++ | |
if: contains(matrix.os, 'ubuntu') && matrix.compiler == 'clang' | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 19 | |
sudo apt-get install -yq --no-install-recommends libc++-19-dev libc++abi-19-dev | |
- name: Setup gcc and libstdc++ | |
if: contains(matrix.os, 'ubuntu') && matrix.compiler == 'gcc' | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -yq --no-install-recommends gcc-13 g++-13 libstdc++-13-dev | |
- name: Prepare build | |
run: | | |
if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
cmake -B build -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13 DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCOMMON_BUILD_TESTS=ON -DCMKR_SKIP_GENERATION=ON | |
elif [ "${{ matrix.compiler }}" = "clang" ]; then | |
cmake -B build -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCOMMON_BUILD_TESTS=ON -DCMKR_SKIP_GENERATION=ON | |
else | |
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCOMMON_BUILD_TESTS=ON -DCMKR_SKIP_GENERATION=ON | |
fi | |
- name: Build | |
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
- name: Test (Unix) | |
if: contains(matrix.os, 'ubuntu') | |
run: ./build/common-tests | |
- name: Test (Windows) | |
if: contains(matrix.os, 'windows') | |
run: .\build\${{ env.BUILD_TYPE }}\common-tests.exe |