Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run TSan and ASan on every C++ version #57

Merged
merged 2 commits into from
Oct 30, 2024
Merged
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
60 changes: 24 additions & 36 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ jobs:
strategy:
matrix:
preset: ["gcc-debug", "gcc-release"]
name: "Preset Test: ${{ matrix.preset }}"
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmake-version: '3.25.x'
- uses: seanmiddleditch/gha-setup-ninja@v5
cmakeVersion: "~3.25.0"
ninjaVersion: "^1.11.1"
Comment on lines +19 to +26
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tidying stuff up here. Giving preset test a better name and use the same setup-cmake action as the one below for consistency.

- name: Run preset
run: cmake --workflow --preset ${{ matrix.preset }}

Expand All @@ -36,43 +37,33 @@ jobs:
c: gcc
- cpp: clang++
c: clang
cpp_version: [17, 20, 23, 26]
cmake_args:
- description: "Static default"
- description: "Default"
args: ""
- description: "Dynamic default"
args: "-DBUILD_SHARED_LIBS=on"
- description: "static C++17"
args: "-DCMAKE_CXX_STANDARD=17"
- description: "static C++20"
args: "-DCMAKE_CXX_STANDARD=20"
- description: "static C++23"
args: "-DCMAKE_CXX_STANDARD=23"
- description: "static C++26"
args: "-DCMAKE_CXX_STANDARD=26"
- description: "TSan"
args: "-DCMAKE_CXX_FLAGS=-fsanitize=thread"
- description: "ASan"
args: "-DCMAKE_CXX_FLAGS=-fsanitize=address -fsanitize=undefined"
include:
- platform: ubuntu-latest
compiler:
cpp: g++
c: gcc
cpp_version: 17
cmake_args:
description: "Werror"
cmake_args: "-DCMAKE_CXX_FLAGS='-Werror=all -Werror=extra'"
- platform: ubuntu-latest
compiler:
cpp: g++
c: gcc
cpp_version: 17
cmake_args:
description: "A-San"
cmake_args: "-DCMAKE_CXX_FLAGS=-fsanitize=address -fsanitize=undefined"
- platform: ubuntu-latest
compiler:
cpp: g++
c: gcc
cmake_args:
description: "T-San"
cmake_args: "-DCMAKE_CXX_FLAGS=-fsanitize=thread"
description: "Dynamic"
cmake_args: "-DBUILD_SHARED_LIBS=on"

name: "Bulid & Test: ${{ matrix.compiler.c }} ${{ matrix.cmake_args.description }}"
name: "Bulid & Test: ${{ matrix.compiler.c }} ${{ matrix.cpp_version }} ${{ matrix.cmake_args.description }}"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
Expand All @@ -87,31 +78,28 @@ jobs:
g++ --version
cmake --version
ninja --version
- name: Configure CMake
run: |
cmake -B build -S . "-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }} ${{ matrix.cmake_args.args }}"
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Build Release
run: |
cmake -B build -S . "${{ matrix.cmake_args.args }}"
cmake --build build --config Release --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Test Release
run: ctest --test-dir build --build-config Release
- name: Build Debug
run: |
cmake -B build -S . "${{ matrix.cmake_args.args }}"
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Test Release
- name: Test Debug
run: ctest --test-dir build --build-config Debug

create-issue-when-fault:
Expand Down