forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (200 loc) · 7.42 KB
/
linux.yaml
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
---
name: Linux
on:
push:
branches:
- master
- me/*
- releases/gcc-*
tags:
- releases/gcc-*
pull_request:
branches:
- master
- me/*
- releases/gcc-*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.name }}-build
runs-on: ubuntu-latest
timeout-minutes: 720
strategy:
matrix:
include:
- name: ubuntu-x64
target: x86_64
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get -y install gcc-multilib build-essential flex zlib1g-dev \
gnat gdc expect dejagnu libc-dev libc-devtools texlive findutils \
binutils autogen gettext autopoint libasprintf-dev \
libgettextpo-dev mailutils mailutils-mh procmail emacs exim4-base \
msmtp bsd-mailx
- name: Install dependencies for aarch64
if: success() && contains(matrix.target, 'aarch64')
run: |
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
binutils-aarch64-linux-gnu
- name: Stamp
if: success()
env:
revision: ${{ github.head_ref }}
run: |
if test -z "${revision}"; then revision=0; fi
{
sync && date
sync && echo "$(TZ=UTC date) (revision ${revision})"
} > LAST_UPDATED
- name: Cache
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-downloaded-prerequisites
with:
path: ../build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('LAST_UPDATED') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Download prerequisites
if: success()
run: |
./contrib/download_prerequisites
ls
- name: Configure x86_64
if: success() && matrix.target == 'x86_64'
run: |
if test -n "${ADA_INCLUDE_PATH}"; then unset ADA_INCLUDE_PATH; fi
if test -n "${ADA_OBJECT_PATH}"; then unset ADA_OBJECT_PATH; fi
cd ../
if test ! -d build; then mkdir build; fi
cd build
../gcc/configure \
--enable-languages=c,c++,lto,objc,obj-c++ \
--prefix=/usr \
--with-gcc-major-version-only \
--program-prefix=x86_64-linux-gnu- \
--libexecdir=/usr/lib \
--without-included-gettext \
--enable-threads=posix \
--libdir=/usr/lib \
--disable-vtable-verify \
--with-system-zlib \
--with-target-system-zlib=auto \
--disable-bootstrap \
--disable-werror \
--with-tune=generic \
--without-cuda-driver \
--enable-checking=release \
--enable-silent-rules \
--build=x86_64-linux-gnu \
--host=x86_64-linux-gnu \
--target=x86_64-linux-gnu
- name: Make
if: success()
run: |
cd ../build
if test -x "$(which nproc)"; then \
echo "nproc says that we can use $(nproc) build jobs"; \
else echo "error: missing nproc!" >&2 && exit 1; fi
time (make -j"$(nproc)" | tee build.log)
if test -e build.log; then stat build.log && wc -l build.log; fi
- name: Debug failure
if: failure()
run: |
if test -r build.log; then grep -i "error:" build.log; \
elif test -r ../build/build.log; then \
grep -i "error:" ../build/build.log; \
elif test -e ../build/Makefile; then \
sudo apt-get -y install remake; \
cd ../build; \
remake -dpPw --trace=full; \
elif test -d ../build; then \
cd ../build && ls; \
else \
pwd && ls; \
fi
- name: Make docs (post-build)
if: success()
run: |
cd ../build
echo "make info" && (time make info) && find . -name "*.info" -print
echo "make dvi" && (time make dvi) && find . -name "*.dvi" -print
echo "make pdf" && (time make pdf) && find . -name "*.pdf" -print
echo "make html" && (time make html) && find . -name "*.html" -print
- name: Make install (plus docs)
if: success()
run: |
cd ../build
sudo make install
sudo make install-info
sudo make install-dvi
sudo make install-pdf
sudo make install-html
sudo make dir.info
- name: Tests
if: success()
run: |
if test -x /usr/bin/x86_64-linux-gnu-gcc; then \
/usr/bin/x86_64-linux-gnu-gcc --version; \
/usr/bin/x86_64-linux-gnu-gcc -v; \
elif test -x ../build/gcc/xgcc; then \
../build/gcc/xgcc --version && sync && ../build/gcc/xgcc -v; \
fi
cd ../build
if test -e build.log; then make warning.log; fi
time (make -k -j"$(nproc)" check RUNTESTFLAGS="compile.exp dg-torture.exp execute.exp old-deja.exp" | tee testsuite_output.log)
if test -e warning.log; then \
make mail-report-with-warnings.log; \
else make mail-report.log; fi
if test -x "$(which Mail)"; then \
if test -x mail-report-with-warnings.log; then \
echo "attempting to send mail-report-with-warnings.log"; \
./mail-report-with-warnings.log; \
stat mail-report-with-warnings.log; \
wc -l mail-report-with-warnings.log; \
du mail-report-with-warnings.log; \
elif test -x mail-report.log; then \
echo "attempting to send mail-report.log"; \
./mail-report.log; \
stat mail-report.log && wc -l mail-report.log; \
du mail-report.log; \
elif test -e testsuite_output.log; then \
echo "TODO: figure out a way to send testsuite_output.log"; \
stat testsuite_output.log && wc -l testsuite_output.log; \
du testsuite_output.log; \
else \
echo "Nothing to send."; \
fi; \
else \
echo "Warning: \"Mail\" program is missing, so skipping emailing of testresults!"; \
fi
for mydir in "${OLDPWD}" .. build path testsuite ../build ../path ../testsuite "${OLDPWD}"/build "${OLDPWD}"/path "${OLDPWD}"/testsuite; do \
if test -d "${mydir}" && test -r "${mydir}" && test -w "${mydir}" && test -x "${mydir}"; then \
find . -name '*.log' -exec cp -v {} "${mydir}" ";" || echo "failed copying a logfile to ${mydir}"; \
break; \
else \
echo "skipping attempt to copy logfiles to ${mydir}"; \
fi; \
done
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.4.3
with:
# Artifact name
name: logfiles
# A file, directory or wildcard pattern that describes what to upload
path: |
*.log
build/*.log
path/*.log
testsuite/*.log