12
12
workflow_dispatch :
13
13
14
14
jobs :
15
- linux :
15
+ ubuntu :
16
16
strategy :
17
17
matrix :
18
18
# Build each combination of OS and release/debug variants
19
- os : [ "ubuntu-latest", "ubuntu-20.04", "macos-11", "macos-12" ]
20
- build-type : [ Release, Debug ]
19
+ os : [ "ubuntu-latest", "ubuntu-20.04" ]
20
+ build-type : [ " Release", " Debug" ]
21
21
# Extra cmake flags. GitHub Actions matrix overloads `include` to mean
22
22
# 'add extra things to a job' and 'add jobs'. You can add extra things
23
23
# to a job by specifying things that exist in a job created from the
24
24
# matrix definition and adding things. You can specify extra jobs by
25
25
# specifying properties that don't match existing jobs. We use
26
26
# `cmake-flags` to add cmake flags to all jobs matching a pattern and
27
27
# `extra-cmake-flags` to specify a new job with custom CMake flags.
28
+ #
29
+ # Note that adding new jobs does not *refine* existing matrix entries,
30
+ # but rather adds new tuples wholesale. That is, specifying "os" alone
31
+ # will result in a tuple without set "build-type" rather than one for
32
+ # each existing "build-type" value!
28
33
extra-cmake-flags : [ "" ]
29
34
# Modify the complete matrix
30
35
include :
31
- # Provide the dependency installation for each platform
32
- - os : " ubuntu-20.04"
33
- dependencies : " sudo apt install ninja-build"
34
- cmake-flags : " -DSNMALLOC_USE_CXX17=ON"
35
36
- os : " ubuntu-20.04"
36
- dependencies : " sudo apt install ninja-build"
37
- - os : " ubuntu-latest" # 22.04 at time of writing
38
- dependencies : " sudo apt install ninja-build"
39
- - os : " macos-11"
40
- # The homebrew packages are broken at the moment and error out
41
- # after trying to install Python as a dependency of ninja because
42
- # 2to3 exists. As a quick hack, delete it first. This should be
43
- # removed once the homebrew install is fixed.
44
- dependencies : " rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
45
- - os : " macos-12"
46
- dependencies : " rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
47
- - os : " macos-12"
48
37
variant : " C++17"
49
- dependencies : " rm -f /usr/local/bin/2to3 ; brew update && brew install ninja "
50
- cmake-flags : " -DSNMALLOC_USE_CXX17=ON"
38
+ build-type : " Debug "
39
+ extra- cmake-flags : " -DSNMALLOC_USE_CXX17=ON"
51
40
# Add the self-host build, using the bounds-checked memcpy in
52
41
# maximally paranoid mode (checking loads and stores)
53
42
- os : " ubuntu-latest"
54
43
build-type : Debug
55
44
self-host : true
56
45
extra-cmake-flags : " -DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
57
- dependencies : " sudo apt install ninja-build"
58
46
# Extra build to check using pthread library for destructing local state.
59
47
- os : " ubuntu-latest"
60
48
variant : " with pthread destructors"
61
- dependencies : " sudo apt install ninja-build"
62
49
build-type : Debug
63
50
self-host : true
64
51
extra-cmake-flags : " -DSNMALLOC_USE_PTHREAD_DESTRUCTORS=On"
65
52
# Extra build to check using individual mitigations works.
66
53
- os : " ubuntu-latest"
67
54
variant : " individual mitigations"
68
- dependencies : " sudo apt install ninja-build"
69
55
build-type : Release
70
56
self-host : true
71
57
extra-cmake-flags : " -DSNMALLOC_BENCHMARK_INDIVIDUAL_MITIGATIONS=On -DSNMALLOC_BUILD_TESTING=Off"
72
58
# Check that we can build specifically with libstdc++
73
59
- os : " ubuntu-latest"
74
60
variant : " libstdc++ (Build only)"
75
- dependencies : " sudo apt install ninja-build "
61
+ build-type : Release
76
62
extra-cmake-flags : " -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libstdc++"
77
63
build-only : yes
78
64
# Replay some of the above tests with clang-10 specifically
79
65
- os : " ubuntu-20.04"
80
66
variant : " clang-10 (with pthread destructors)."
81
- dependencies : " sudo apt install ninja-build"
82
67
build-type : Debug
83
68
self-host : true
84
69
extra-cmake-flags : " -DSNMALLOC_USE_PTHREAD_DESTRUCTORS=On -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_C_COMPILER=clang-10"
85
70
- os : " ubuntu-20.04"
86
71
variant : " clang-10 libstdc++ (Build only)"
87
- dependencies : " sudo apt install ninja-build "
72
+ build-type : Release
88
73
extra-cmake-flags : " -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_FLAGS=-stdlib=libstdc++"
89
74
build-only : yes
90
75
# Don't abort runners if a single one fails
94
79
steps :
95
80
- uses : actions/checkout@v3
96
81
- name : Install build dependencies
97
- run : ${{ matrix.dependencies }}
82
+ run : " sudo apt install ninja-build "
98
83
99
84
- uses : mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
100
85
with :
@@ -121,6 +106,49 @@ jobs:
121
106
mkdir libs
122
107
cp libsnmallocshim*.so libs
123
108
for lib in `ls libs`; do echo; echo Testing $lib; ninja clean; LD_PRELOAD=libs/$lib ninja libsnmallocshim.so; done
109
+
110
+ # If this looks remarkably familiar, that's because it is. Sigh.
111
+ macos :
112
+ strategy :
113
+ matrix :
114
+ os : [ "macos-12", "macos-14" ]
115
+ build-type : [ "Release", "Debug" ]
116
+ extra-cmake-flags : [ "", "-DSNMALLOC_USE_CXX17=ON" ]
117
+ fail-fast : false
118
+ runs-on : ${{ matrix.os }}
119
+ name : ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.extra-cmake-flags }}
120
+ steps :
121
+ - uses : actions/checkout@v3
122
+ - name : Install build dependencies
123
+ # The homebrew packages are broken at the moment and error out
124
+ # after trying to install Python as a dependency of ninja because
125
+ # 2to3 exists. As a quick hack, delete it first. This should be
126
+ # removed once the homebrew install is fixed.
127
+ run : " rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
128
+
129
+ - name : Configure CMake
130
+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja ${{ matrix.cmake-flags }} ${{ matrix.extra-cmake-flags }}
131
+ # Build with a nice ninja status line
132
+ - name : Build
133
+ working-directory : ${{github.workspace}}/build
134
+ run : NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
135
+ - name : Test file size of binaries is sane
136
+ working-directory : ${{github.workspace}}/build
137
+ run : " ls -l libsnmallocshim.* ; [ $(ls -l libsnmallocshim.* | awk '{ print $5}') -lt 10000000 ]"
138
+ # If the tests are enabled for this job, run them
139
+ - name : Test
140
+ if : ${{ matrix.build-only != 'yes' }}
141
+ working-directory : ${{github.workspace}}/build
142
+ run : ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400
143
+ - name : Selfhost
144
+ if : ${{ matrix.self-host }}
145
+ working-directory : ${{github.workspace}}/build
146
+ run : |
147
+ mkdir libs
148
+ cp libsnmallocshim*.so libs
149
+ for lib in `ls libs`; do echo; echo Testing $lib; ninja clean; LD_PRELOAD=libs/$lib ninja libsnmallocshim.so; done
150
+
151
+
124
152
# GitHub doesn't natively support *BSD, but we can run them in VMs on Mac /
125
153
# Linux runners
126
154
freebsd :
@@ -459,7 +487,7 @@ jobs:
459
487
460
488
all-checks :
461
489
# Currently FreeBSD and NetBSD CI are not working, so we do not require them to pass.
462
- needs : [linux, qemu-crossbuild, windows, format, sanitizer ]
490
+ needs : [ubuntu, macos, freebsd, netbsd, sanitizer, qemu-crossbuild, windows, format]
463
491
runs-on : ubuntu-latest
464
492
steps :
465
493
- name : Dummy step
0 commit comments