114 lines
3.2 KiB
YAML
114 lines
3.2 KiB
YAML
name: Chaos Ci
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Install
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake valgrind lcov
|
|
|
|
- name: Build tests
|
|
run: |
|
|
mkdir build-debug
|
|
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug
|
|
cmake --build build-debug/ -t ChaosTests
|
|
|
|
- name: Build tests with coverage
|
|
run: |
|
|
mkdir build-debug-coverage
|
|
cmake -S . -B build-debug-coverage/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON
|
|
cmake --build build-debug-coverage/ -t ChaosTests
|
|
|
|
- name: Build tests with ASan and UBSan
|
|
run: |
|
|
mkdir build-debug-asanubsan
|
|
cmake -S . -B build-debug-asanubsan/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_ASANUBSAN=ON
|
|
cmake --build build-debug-asanubsan/ -t ChaosTests
|
|
|
|
- name: Run tests under valgrind
|
|
run: valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all --error-exitcode=1 ./build-debug/ChaosTests/ChaosTests
|
|
|
|
- name: Run tests under ASan and UBSan
|
|
run: ASAN_OPTIONS=verbosity=1 UBSAN_OPTIONS=verbosity=1 ./build-debug-asanubsan/ChaosTests/ChaosTests
|
|
|
|
- name: Run tests for coverage
|
|
run: ./build-debug-coverage/ChaosTests/ChaosTests
|
|
|
|
- name: Process coverage data
|
|
run: |
|
|
lcov --exclude '*/usr/*' --exclude '*/_deps/*' --exclude '*/ChaosTests/*' -c -d build-debug-coverage/ -o lcovout
|
|
genhtml lcovout -o coverage-report/
|
|
|
|
- name: Upload coverage report
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: CoverageReport
|
|
path: coverage-report/
|
|
if-no-files-found: error
|
|
include-hidden-files: true
|
|
retention-days: 10
|
|
|
|
static-analysis:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Install
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake cppcheck
|
|
|
|
- name: Generate compile commands
|
|
run: |
|
|
mkdir build-debug
|
|
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_EXPORT_COMPILE_COMMANDS=ON
|
|
|
|
- name: Run cppcheck
|
|
run: |
|
|
cppcheck --version
|
|
cppcheck --project=build-debug/compile_commands.json \
|
|
--file-filter='*ChaosTests/*' \
|
|
--file-filter='*ChaosBenches/*' \
|
|
--enable=warning,performance,portability \
|
|
--suppress='*:*/_deps/*' \
|
|
--suppress=missingIncludeSystem \
|
|
--inline-suppr \
|
|
--error-exitcode=1
|
|
|
|
benchmark:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Install
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake
|
|
|
|
- name: Build benchmarks
|
|
run: |
|
|
mkdir build-release
|
|
cmake -S . -B build-release/ -D CMAKE_BUILD_TYPE=Release
|
|
cmake --build build-release/ -t ChaosBenches
|
|
|
|
- name: Run benchmarks
|
|
run: ./build-release/ChaosBenches/ChaosBenches
|