forked from logrotate/logrotate
-
Notifications
You must be signed in to change notification settings - Fork 0
210 lines (155 loc) · 5.99 KB
/
build-ci.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
name: Build CI
on: [push, pull_request]
jobs:
build-linux:
name: Build with ${{ matrix.cc }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cc: [ gcc, clang ]
os: [ ubuntu-20.04, ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install dependencies
run: sudo apt-get install -y acl automake libacl1-dev libpopt-dev libselinux1-dev rpm
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --disable-silent-rules
- name: Build
run: make -k
- name: Testsuite
run: make -j9 check || ( cat test/test-suite.log; exit 1; )
- name: Install
run: sudo make install
- name: Installcheck
run: make installcheck
- name: Distcheck
run: make -j9 distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --disable-silent-rules"
- name: Build rpm
run: make rpm RPM_FLAGS="--nodeps"
build-macos:
name: Build with clang on macOS
runs-on: macOS-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install dependencies
run: brew install automake coreutils popt
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --disable-silent-rules
- name: Build
run: make -k
- name: Testsuite
run: make -j9 check || ( cat test/test-suite.log; exit 1; )
- name: Install
run: sudo make install
- name: Installcheck
run: make installcheck
- name: Distcheck
run: make -j9 distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --disable-silent-rules"
build-clang-analyzer:
name: Clang Analyzer
runs-on: ubuntu-latest
env:
CC: clang-18
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install Clang repo
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --yes --dearmor --output /usr/share/keyrings/llvm-snapshot.gpg
echo 'deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main' | sudo tee /etc/apt/sources.list.d/llvm-snapshot.list
sudo apt-get update -q
- name: Install dependencies
run: sudo apt-get install -y automake clang-18 clang-tools-18 libacl1-dev libpopt-dev libselinux1-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: scan-build-18 -analyze-headers --status-bugs ./configure --enable-werror --disable-silent-rules
- name: Analyze
run: scan-build-18 -analyze-headers --status-bugs make -j"$(nproc)"
build-clang-sanitizer:
name: Clang Sanitizer
runs-on: ubuntu-latest
env:
CC: clang-18
CFLAGS: '-O1 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
UBSAN_OPTIONS: print_stacktrace=1:print_summary=1:halt_on_error=1
LSAN_OPTIONS: suppressions=test/leak_san_suppress.txt
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install Clang repo
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --yes --dearmor --output /usr/share/keyrings/llvm-snapshot.gpg
echo 'deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main' | sudo tee /etc/apt/sources.list.d/llvm-snapshot.list
sudo apt-get update -q
- name: Install dependencies
run: sudo apt-get install -y acl automake clang-18 libacl1-dev libpopt-dev libselinux1-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --disable-silent-rules
- name: Build
run: make -j"$(nproc)"
- name: Testsuite
run: make -j9 check || ( cat test/test-suite.log; exit 1; )
- name: Scan for sanitizer issues
run: |
issues="$( grep -riE 'sanitizer|runtime error' test/*.log )" || true
if [ -n "$issues" ]; then
echo "Found sanitizer issues:"
echo "$issues"
exit 1;
fi
build-gcc-analyzer:
name: GCC Analyzer
runs-on: ubuntu-latest
env:
CC: gcc-12
CFLAGS: -O3 -flto=auto -finline-limit=1000 -fanalyzer
LDFLAGS: -O3 -flto=auto -finline-limit=1000 -fanalyzer
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install dependencies
run: sudo apt-get install -y automake gcc-12 libacl1-dev libpopt-dev libselinux1-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --disable-silent-rules
- name: Analyze
run: make -j"$(nproc)"
build-gcc-c89:
name: GCC C89
runs-on: ubuntu-latest
env:
CFLAGS: -O2 -g -std=c89
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Install dependencies
run: sudo apt-get install -y automake libacl1-dev libpopt-dev libselinux1-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --disable-silent-rules
- name: Build
run: make -j"$(nproc)"
space-check:
name: Space Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Spaces check
run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
- name: Tab check
run: |
issues="$( grep "$(printf '\t')" config.c log.{c,h} logrotate.{c,h} )" || true
if [ -n "$issues" ]; then
echo "Found tab issues:"
echo "$issues"
exit 1;
fi