-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (133 loc) · 4.27 KB
/
Copy pathci.yml
File metadata and controls
155 lines (133 loc) · 4.27 KB
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
name: CI
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
build-and-test:
name: Build & Test (GCC)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Configure
env:
CC: gcc
run: cmake -S . -B build -DTCLI_BUILD_TESTS=ON -DTCLI_BUILD_EXAMPLES=ON -DTCLI_WERROR=ON
- name: Build
run: cmake --build build --parallel
- name: Run tests
run: ctest --test-dir build --output-on-failure
configurations:
name: Config (${{ matrix.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: no-users
defines: TCLIE_ENABLE_USERS=0
- name: no-usernames
defines: TCLIE_ENABLE_USERNAMES=0
- name: no-pattern-match
defines: TCLIE_PATTERN_MATCH=0
- name: no-history
defines: TCLI_HISTORY_BUF_LEN=0
- name: no-output-buffer
defines: TCLI_OUTPUT_BUF_LEN=0
- name: no-completion
defines: TCLI_COMPLETE=0
- name: small
defines: TCLI_CMDLINE_MAX_LEN=32;TCLI_MAX_TOKENS=4
# Matches the Uno environment in examples/platformio/platformio.ini.
- name: minimal
defines: TCLIE_ENABLE_USERS=0;TCLIE_PATTERN_MATCH=0;TCLI_HISTORY_BUF_LEN=0;TCLI_OUTPUT_BUF_LEN=0;TCLI_COMPLETE=0
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Configure
env:
CC: gcc
run: >
cmake -S . -B build -DTCLI_BUILD_TESTS=ON -DTCLI_BUILD_EXAMPLES=ON
-DTCLI_WERROR=ON "-DTCLI_CONFIG_DEFINITIONS=${{ matrix.defines }}"
- name: Build
run: cmake --build build --parallel
- name: Run tests
run: ctest --test-dir build --output-on-failure
windows:
name: Build & Test (MSVC)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DTCLI_BUILD_TESTS=ON -DTCLI_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build build --config Debug --parallel
- name: Run tests
run: ctest --test-dir build --build-config Debug --output-on-failure
sanitizers:
name: Clang + ASan + UBSan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Configure
env:
CC: clang
CFLAGS: -fsanitize=address,undefined -fno-omit-frame-pointer -g
LDFLAGS: -fsanitize=address,undefined
run: cmake -S . -B build -DTCLI_BUILD_TESTS=ON -DTCLI_BUILD_EXAMPLES=ON -DTCLI_WERROR=ON
- name: Build
run: cmake --build build --parallel
- name: Run tests
env:
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1
run: ctest --test-dir build --output-on-failure
fuzz-smoke:
name: libFuzzer smoke (${{ matrix.harness }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
harness: [fuzz_stateless, fuzz_stateful]
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Configure
env:
CC: clang
run: cmake -S . -B build -DTCLI_BUILD_FUZZERS=ON
- name: Build
run: cmake --build build --parallel
- name: Run fuzzer (60s)
env:
# Hand SIGABRT (asserts) to ASan so it prints a backtrace instead of
# libFuzzer's "rudimentary signal handlers" minimal output.
ASAN_OPTIONS: abort_on_error=1:print_stacktrace=1:symbolize=1:halt_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
run: |
./build/fuzz/${{ matrix.harness }} \
-max_total_time=60 \
-print_final_stats=1 \
-handle_abrt=0
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@v7
with:
name: fuzz-crash-${{ matrix.harness }}
path: |
crash-*
leak-*
slow-unit-*
oom-*
timeout-*
if-no-files-found: ignore