Skip to content

Commit 08a2ef2

Browse files
committed
CI: Add GitHub Actions based on passwdqc's
1 parent b5795b8 commit 08a2ef2

File tree

4 files changed

+396
-0
lines changed

4 files changed

+396
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 2

.github/workflows/ci.yml

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
whitespace-errors:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
- name: check
11+
run: git diff-index --check --cached 4b825dc642cb6eb9a060e54bf8d69288fbee4904
12+
13+
gcc14-x86_64:
14+
runs-on: ubuntu-24.04
15+
env:
16+
CC: gcc-14
17+
TARGET: x86_64
18+
steps:
19+
- uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 0
22+
- name: install dependencies
23+
run: ci/install-dependencies.sh
24+
- name: build check
25+
run: ci/run-build-and-tests.sh
26+
27+
gcc13-x86_64:
28+
runs-on: ubuntu-latest
29+
env:
30+
CC: gcc-13
31+
TARGET: x86_64
32+
steps:
33+
- uses: actions/checkout@v5
34+
with:
35+
fetch-depth: 0
36+
- name: install dependencies
37+
run: ci/install-dependencies.sh
38+
- name: build check
39+
run: ci/run-build-and-tests.sh
40+
41+
gcc12-x86_64:
42+
runs-on: ubuntu-latest
43+
env:
44+
CC: gcc-12
45+
TARGET: x86_64
46+
steps:
47+
- uses: actions/checkout@v5
48+
with:
49+
fetch-depth: 0
50+
- name: install dependencies
51+
run: ci/install-dependencies.sh
52+
- name: build check
53+
run: ci/run-build-and-tests.sh
54+
55+
gcc11-x86_64:
56+
runs-on: ubuntu-latest
57+
env:
58+
CC: gcc-11
59+
TARGET: x86_64
60+
steps:
61+
- uses: actions/checkout@v5
62+
with:
63+
fetch-depth: 0
64+
- name: install dependencies
65+
run: ci/install-dependencies.sh
66+
- name: build check
67+
run: ci/run-build-and-tests.sh
68+
69+
gcc10-x86_64:
70+
runs-on: ubuntu-latest
71+
env:
72+
CC: gcc-10
73+
TARGET: x86_64
74+
steps:
75+
- uses: actions/checkout@v5
76+
with:
77+
fetch-depth: 0
78+
- name: install dependencies
79+
run: ci/install-dependencies.sh
80+
- name: build check
81+
run: ci/run-build-and-tests.sh
82+
83+
gcc9-x86_64:
84+
runs-on: ubuntu-latest
85+
env:
86+
CC: gcc
87+
TARGET: x86_64
88+
steps:
89+
- uses: actions/checkout@v5
90+
with:
91+
fetch-depth: 0
92+
- name: install dependencies
93+
run: ci/install-dependencies.sh
94+
- name: build check
95+
run: ci/run-build-and-tests.sh
96+
97+
gcc8-x86_64:
98+
runs-on: ubuntu-20.04
99+
env:
100+
CC: gcc-8
101+
TARGET: x86_64
102+
steps:
103+
- uses: actions/checkout@v5
104+
with:
105+
fetch-depth: 0
106+
- name: install dependencies
107+
run: ci/install-dependencies.sh
108+
- name: build check
109+
run: ci/run-build-and-tests.sh
110+
111+
clang18-x86_64:
112+
runs-on: ubuntu-24.04
113+
env:
114+
CC: clang-18
115+
TARGET: x86_64
116+
steps:
117+
- uses: actions/checkout@v5
118+
with:
119+
fetch-depth: 0
120+
- name: install dependencies
121+
run: ci/install-dependencies.sh
122+
- name: build check
123+
run: ci/run-build-and-tests.sh
124+
125+
clang17-x86_64:
126+
runs-on: ubuntu-24.04
127+
env:
128+
CC: clang-17
129+
TARGET: x86_64
130+
steps:
131+
- uses: actions/checkout@v5
132+
with:
133+
fetch-depth: 0
134+
- name: install dependencies
135+
run: ci/install-dependencies.sh
136+
- name: build check
137+
run: ci/run-build-and-tests.sh
138+
139+
clang16-x86_64:
140+
runs-on: ubuntu-24.04
141+
env:
142+
CC: clang-16
143+
TARGET: x86_64
144+
steps:
145+
- uses: actions/checkout@v5
146+
with:
147+
fetch-depth: 0
148+
- name: install dependencies
149+
run: ci/install-dependencies.sh
150+
- name: build check
151+
run: ci/run-build-and-tests.sh
152+
153+
clang15-x86_64:
154+
runs-on: ubuntu-latest
155+
env:
156+
CC: clang-15
157+
TARGET: x86_64
158+
steps:
159+
- uses: actions/checkout@v5
160+
with:
161+
fetch-depth: 0
162+
- name: install dependencies
163+
run: ci/install-dependencies.sh
164+
- name: build check
165+
run: ci/run-build-and-tests.sh
166+
167+
clang14-x86_64:
168+
runs-on: ubuntu-latest
169+
env:
170+
CC: clang-14
171+
TARGET: x86_64
172+
steps:
173+
- uses: actions/checkout@v5
174+
with:
175+
fetch-depth: 0
176+
- name: install dependencies
177+
run: ci/install-dependencies.sh
178+
- name: build check
179+
run: ci/run-build-and-tests.sh
180+
181+
clang13-x86_64:
182+
runs-on: ubuntu-22.04
183+
env:
184+
CC: clang-13
185+
TARGET: x86_64
186+
steps:
187+
- uses: actions/checkout@v5
188+
with:
189+
fetch-depth: 0
190+
- name: install dependencies
191+
run: ci/install-dependencies.sh
192+
- name: build check
193+
run: ci/run-build-and-tests.sh
194+
195+
clang12-x86_64:
196+
runs-on: ubuntu-22.04
197+
env:
198+
CC: clang-12
199+
TARGET: x86_64
200+
steps:
201+
- uses: actions/checkout@v5
202+
with:
203+
fetch-depth: 0
204+
- name: install dependencies
205+
run: ci/install-dependencies.sh
206+
- name: build check
207+
run: ci/run-build-and-tests.sh
208+
209+
clang11-x86_64:
210+
runs-on: ubuntu-22.04
211+
env:
212+
CC: clang-11
213+
TARGET: x86_64
214+
steps:
215+
- uses: actions/checkout@v5
216+
with:
217+
fetch-depth: 0
218+
- name: install dependencies
219+
run: ci/install-dependencies.sh
220+
- name: build check
221+
run: ci/run-build-and-tests.sh
222+
223+
clang10-x86_64:
224+
runs-on: ubuntu-latest
225+
env:
226+
CC: clang
227+
TARGET: x86_64
228+
steps:
229+
- uses: actions/checkout@v5
230+
with:
231+
fetch-depth: 0
232+
- name: install dependencies
233+
run: ci/install-dependencies.sh
234+
- name: build check
235+
run: ci/run-build-and-tests.sh
236+
237+
clang9-x86_64:
238+
runs-on: ubuntu-20.04
239+
env:
240+
CC: clang-9
241+
TARGET: x86_64
242+
steps:
243+
- uses: actions/checkout@v5
244+
with:
245+
fetch-depth: 0
246+
- name: install dependencies
247+
run: ci/install-dependencies.sh
248+
- name: build check
249+
run: ci/run-build-and-tests.sh
250+
251+
clang8-x86_64:
252+
runs-on: ubuntu-20.04
253+
env:
254+
CC: clang-8
255+
TARGET: x86_64
256+
steps:
257+
- uses: actions/checkout@v5
258+
with:
259+
fetch-depth: 0
260+
- name: install dependencies
261+
run: ci/install-dependencies.sh
262+
- name: build check
263+
run: ci/run-build-and-tests.sh

ci/install-dependencies.sh

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/sh -ex
2+
#
3+
# Copyright (c) 2018-2020 The strace developers.
4+
# All rights reserved.
5+
#
6+
# SPDX-License-Identifier: GPL-2.0-or-later
7+
8+
j=-j`nproc` || j=
9+
type sudo >/dev/null 2>&1 && sudo=sudo || sudo=
10+
common_packages='make'
11+
12+
retry_if_failed()
13+
{
14+
for i in `seq 0 99`; do
15+
"$@" && i= && break || sleep 1
16+
done
17+
[ -z "$i" ]
18+
}
19+
20+
updated=
21+
apt_get_install()
22+
{
23+
[ -n "$updated" ] || {
24+
retry_if_failed $sudo apt-get -qq update
25+
updated=1
26+
}
27+
retry_if_failed $sudo \
28+
apt-get -qq --no-install-suggests --no-install-recommends \
29+
install -y "$@"
30+
}
31+
32+
git_installed=
33+
clone_repo()
34+
{
35+
local src dst branch
36+
src="$1"; shift
37+
dst="$1"; shift
38+
branch="${1-}"
39+
40+
[ -n "$git_installed" ] || {
41+
apt_get_install git ca-certificates
42+
git_installed=1
43+
}
44+
45+
case "$src" in
46+
*://*) ;;
47+
*) local url path
48+
url="$(git config remote.origin.url)"
49+
path="${url#*://*/}"
50+
src="${url%$path}$src"
51+
;;
52+
esac
53+
54+
retry_if_failed \
55+
git clone --depth=1 ${branch:+--branch $branch} "$src" "$dst"
56+
}
57+
58+
case "$TARGET" in
59+
x32|x86)
60+
packages="$common_packages gcc-multilib"
61+
;;
62+
*)
63+
packages="$common_packages gcc"
64+
;;
65+
esac
66+
67+
case "$CC" in
68+
gcc-*)
69+
retry_if_failed \
70+
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
71+
case "$TARGET" in
72+
x32|x86)
73+
apt_get_install $packages "$CC"-multilib "$CC"
74+
;;
75+
*)
76+
apt_get_install $packages "$CC"
77+
;;
78+
esac
79+
;;
80+
clang*)
81+
apt_get_install $packages "$CC"
82+
;;
83+
*)
84+
apt_get_install $packages
85+
;;
86+
esac

ci/run-build-and-tests.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh -ex
2+
#
3+
# Copyright (c) 2018-2020 The strace developers.
4+
# All rights reserved.
5+
#
6+
# SPDX-License-Identifier: GPL-2.0-or-later
7+
8+
case "${TARGET-}" in
9+
x32)
10+
CC="$CC -mx32"
11+
;;
12+
x86)
13+
CC="$CC -m32"
14+
;;
15+
esac
16+
17+
echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION'
18+
uname -a |head -1
19+
libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)"
20+
$libc |head -1
21+
file -L /bin/sh
22+
$CC --version |head -1
23+
$CC -print-multi-lib ||:
24+
make --version |head -1
25+
kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC $CPPFLAGS -E -P -)"
26+
printf 'kernel-headers %s.%s.%s\n' $(($kver/65536)) $(($kver/256%256)) $(($kver%256))
27+
echo 'END OF BUILD ENVIRONMENT INFORMATION'
28+
29+
nproc="$(nproc)" || nproc=1
30+
j="-j$nproc"
31+
32+
make -k $j \
33+
CC="$CC" \
34+
CFLAGS='-Wall -W -Wno-sign-compare -Werror -O2 -D_FILE_OFFSET_BITS=64' \
35+
check
36+
37+
if git status --porcelain |grep ^.; then
38+
echo >&2 'git status reported uncleanness'
39+
exit 1
40+
fi

0 commit comments

Comments
 (0)