-
Notifications
You must be signed in to change notification settings - Fork 7
269 lines (215 loc) · 11.3 KB
/
build.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: L3-Build and test
on: [pull_request]
#! -----------------------------------------------------------------------------
# Ref: For running jobs on Linux & Mac/OSX with one workflow.
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os
#! -----------------------------------------------------------------------------
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [release, debug]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
sudo apt-get install -y pylint pip
# spdlog package needs 'fmt' library as a pre-requisite
sudo apt-get install -y libfmt-dev/jammy
sudo apt-get install -y libspdlog-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install python
brew install pylint
# To install llvm-readelf
brew install llvm
# spdlog package needs 'fmt' library as a pre-requisite
brew install fmt
brew install spdlog
# Check required spdlog and fmt .h files
set -x
ls -l /opt/homebrew/include/spdlog
ls -l /opt/homebrew/include/fmt
ls -l /usr/local/opt
ls -l /opt/homebrew/include/spdlog/
ls -l /opt/homebrew/lib/*spdlog*
set +x
fi
pip install pytest
pip install prettytable
set -x
echo " "
which pylint
which pytest
echo " "
ls -aFlrt
echo " "
#! -------------------------------------------------------------------------
- name: Update PATH
run: |
# This is the $PATH reported by `brew install` for the new binaries
if [ "$RUNNER_OS" == "macOS" ]; then
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
fi
- name: Verify PATH and required readelf binary
run: |
echo "PATH is $PATH"
# Verify that this required binary is found in $PATH
if [ "$RUNNER_OS" == "Linux" ]; then
which readelf
elif [ "$RUNNER_OS" == "macOS" ]; then
which llvm-readelf
fi
#! -------------------------------------------------------------------------
- name: test-test-sh-usages
run: |
./tests/test.sh --help
./tests/test.sh --list
#! -------------------------------------------------------------------------
- name: test-code-formatting
run: |
./tests/test.sh test-pylint-check
# Skip shellcheck on MacOSX. It's throwing up some weird errors!
if [ "$RUNNER_OS" == "Linux" ]; then
shellcheck ./tests/test.sh
fi
#! -------------------------------------------------------------------------
- name: test-pytests
run: |
./tests/test.sh test-pytests
#! -------------------------------------------------------------------------
- name: test-make-help
run: ./tests/test.sh test-make-help
#! -------------------------------------------------------------------------
- name: test-build-and-run-unit-tests
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-unit-tests
- name: test-build-C-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-C-samples
- name: test-run-C-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-C-samples
- name: test-build-Cpp-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-Cpp-samples
- name: test-run-Cpp-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-Cpp-samples
- name: test-build-Cc-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-Cc-samples
- name: test-run-Cc-samples
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-Cc-samples
# -------------------------------------------------------------------------
- name: test-build-and-run-C-samples-with-LOC
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-C-samples-with-LOC
- name: test-run-C-samples-with-LOC-wo-L3_LOC_ENABLED
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-C-samples-with-LOC-wo-L3_LOC_ENABLED
# NOTE: This test should occur immediately after previous one.
- name: test-l3_dump_py-missing-loc_decoder
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-l3_dump_py-missing-loc_decoder
# -------------------------------------------------------------------------
- name: test-build-and-run-Cpp-samples-with-LOC
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-Cpp-samples-with-LOC
- name: test-run-Cpp-samples-with-LOC-wo-L3_LOC_ENABLED
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-Cpp-samples-with-LOC-wo-L3_LOC_ENABLED
# -------------------------------------------------------------------------
- name: test-build-and-run-Cc-samples-with-LOC
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-Cc-samples-with-LOC
- name: test-run-Cc-samples-with-LOC-wo-L3_LOC_ENABLED
run: BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-run-Cc-samples-with-LOC-wo-L3_LOC_ENABLED
# -------------------------------------------------------------------------
- name: test-build-and-run-LOC-unit-test
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-LOC-unit-test
# -------------------------------------------------------------------------
# For easier debugging: run following LOC-ELF build-and-test jobs with
# verbose Make outputs: BUILD_VERBOSE=1
- name: test-build-and-run-C-samples-with-LOC-ELF
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-C-samples-with-LOC-ELF
# -------------------------------------------------------------------------
- name: test-build-and-run-Cpp-samples-with-LOC-ELF
run: |
# Do 'clean' here rather than 'clean-l3', so we do full rebuilds
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-Cpp-samples-with-LOC-ELF
# -------------------------------------------------------------------------
- name: test-build-and-run-Cc-samples-with-LOC-ELF
run: |
# Do 'clean' here rather than 'clean-l3', so we do full rebuilds
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-Cc-samples-with-LOC-ELF
# -------------------------------------------------------------------------
# These tests exercise Makefile rules to build-and-run very simple sample
# programs.
- name: test-build-and-run-sample-c-appln
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-sample-c-appln
# -------------------------------------------------------------------------
- name: test-build-and-run-sample-c-appln-with-LOC
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-sample-c-appln-with-LOC
# -------------------------------------------------------------------------
- name: test-build-and-run-sample-c-appln-with-LOC-ELF
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-sample-c-appln-with-LOC-ELF
#! -------------------------------------------------------------------------
# This test will build-and-run -ALL- client-server perf-test, with 1-client
# each sending 1 Million messages to the server. This test-method is
# turned OFF for normal CI-jobs. Enable this, and delete the rest of the
# commands, to validate perf-related changes in a CI-build environment.
# Just run with 1 client as CI-VMs seem to not be very high-powered CPUs.
#! -------------------------------------------------------------------------
# - name: test-run-all-client-server-perf-tests
# run: |
# BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh run-all-client-server-perf-tests $((1000 * 1000)) 1
#! -------------------------------------------------------------------------
# This test will build-and-run client-server perf-test, with L3-Logging OFF
# (baseline) and L3-Logging ON.
#! -------------------------------------------------------------------------
- name: test-build-and-run-client-server-perf-tests
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-csperf-baseline
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-csperf-l3-log
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-csperf-l3-log-no-LOC
#! -------------------------------------------------------------------------
# This test will build-and-run client-server perf-test, with L3-Logging
# ON + L3-LOC encoding scheme ON.
#! -------------------------------------------------------------------------
- name: test-build-and-run-csperf-l3_loc_eq_1
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-csperf-l3_loc_eq_1
#! -------------------------------------------------------------------------
# This test will build-and-run client-server perf-test, with L3-Logging
# ON + L3-LOC-ELF encoding scheme ON.
#! -------------------------------------------------------------------------
- name: test-build-and-run-csperf-l3_loc_eq_2
run: |
BUILD_MODE=${{ matrix.build_type }} ./tests/test.sh test-build-and-run-csperf-l3_loc_eq_2
#! -------------------------------------------------------------------------
# RUN_ON_CI=1 to trigger right selection of spdlog library path on CI-jobs
# that run on Mac/OSX machines.
- name: test-build-and-run-spdlog-sample
run: RUN_ON_CI=1 ./tests/test.sh test-build-and-run-spdlog-sample
#! -------------------------------------------------------------------------
- name: test-build-and-run-source-location-cpp20-sample
run: ./tests/test.sh test-build-and-run-source-location-cpp20-sample
#! -------------------------------------------------------------------------
- name: test-build-and-run-multi-threaded-perf-ubm
run: RUN_ON_CI=1 ./tests/test.sh test-build-and-run-multi-threaded-perf-ubm
# -------------------------------------------------------------------------
# Exercise the do-it-all perf-tests method, which is really intended for
# use by developers, to benchmark with large # of messages. A default
# invocation will run with small # clients & messages, and 1 server-thread.
- name: test-run-all-client-server-perf-tests
run: ./tests/test.sh run-all-client-server-perf-tests
# -------------------------------------------------------------------------
# Exercise the --from-test interface to verify that it still works to
# run thru last pair of code-formatting tests. (Minor duplication of
# these two low-impact tests.)
# -------------------------------------------------------------------------
- name: test-from-test-interface
run: ./tests/test.sh --from-test test-pylint-check