-
Notifications
You must be signed in to change notification settings - Fork 82
104 lines (83 loc) · 3.28 KB
/
CI-unixish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI-unixish
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
compiler: [clang++, g++]
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v4
- name: Install missing software on ubuntu
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install valgrind
- name: Install missing software on ubuntu (clang++)
if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++'
run: |
sudo apt-get update
sudo apt-get install libc++-18-dev
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
# TODO: bail out on warning
- name: make simplecpp
run: make -j$(nproc)
# TODO: bail out on warning
- name: make test
run: make -j$(nproc) test
- name: selfcheck
run: |
make -j$(nproc) selfcheck
- name: Run CMake
run: |
cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On
- name: CMake simplecpp
run: |
cmake --build cmake.output --target simplecpp -- -j $(nproc)
- name: CMake testrunner
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
./cmake.output/testrunner
- name: Run valgrind
if: matrix.os == 'ubuntu-24.04'
run: |
make clean
make -j$(nproc)
valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./testrunner
valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./simplecpp simplecpp.cpp -e
- name: Run with libstdc++ debug mode
if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'g++'
run: |
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-Werror -g3 -D_GLIBCXX_DEBUG"
- name: Run with libc++ hardening mode
if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++'
run: |
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDFLAGS="-lc++"
- name: Run AddressSanitizer
if: matrix.os == 'ubuntu-24.04'
run: |
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-Werror -O2 -g3 -fsanitize=address" LDFLAGS="-fsanitize=address"
env:
ASAN_OPTIONS: detect_stack_use_after_return=1
- name: Run UndefinedBehaviorSanitizer
if: matrix.os == 'ubuntu-24.04'
run: |
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-Werror -O2 -g3 -fsanitize=undefined -fno-sanitize=signed-integer-overflow" LDFLAGS="-fsanitize=undefined -fno-sanitize=signed-integer-overflow"
# TODO: requires instrumented libc++
- name: Run MemorySanitizer
if: false && matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++'
run: |
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-Werror -O2 -g3 -stdlib=libc++ -fsanitize=memory" LDFLAGS="-lc++ -fsanitize=memory"