Skip to content

Commit 5de5d1e

Browse files
committed
ci: change the gcc-5 testing
Use a GCC 5.4.0 built from Compiler Explorer and execute everything on ubuntu 22.04. Use the caching framework provided by github to avoid downloading every time from Compiler Explorer's servers. ChangeLog: * .github/workflows/ccpp.yml: Adjust to use gcc-5 on ubuntu 22.04. Signed-off-by: Marc Poulhiès <[email protected]>
1 parent 1999143 commit 5de5d1e

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

.github/workflows/ccpp.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ jobs:
269269
build-and-check-gcc-5:
270270

271271
runs-on: ubuntu-22.04
272-
container: ubuntu:18.04
273272
env:
274273
# otherwise we hang when installing tzdata
275274
DEBIAN_FRONTEND: noninteractive
@@ -278,52 +277,77 @@ jobs:
278277

279278
- name: Install Deps
280279
run: |
281-
apt-get update;
282-
apt-get install -y \
280+
sudo apt-get update;
281+
sudo apt-get install -y \
283282
curl \
284283
automake \
285284
autoconf \
286285
libtool \
287286
autogen \
288287
bison \
289288
flex \
289+
libc6-dev \
290+
libc6-dev-i386 \
290291
libgmp3-dev \
291292
libmpfr-dev \
292293
libmpc-dev \
293294
build-essential \
294-
gcc-5 \
295-
g++-5 \
296-
gcc-5-multilib \
297-
g++-5-multilib \
298295
dejagnu;
299296
# install Rust directly using rustup
300297
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
301298
299+
- name: Restore cached gcc-5.4
300+
id: restore-gcc5
301+
uses: actions/cache/restore@v4
302+
with:
303+
key: ce-tar-gcc-5
304+
path: ~/gcc-5.4.0/
305+
306+
- name: Download and install gcc5.4
307+
if: ${{ steps.restore-gcc5.outputs.cache-hit != 'true' }}
308+
run: |
309+
curl "https://s3.amazonaws.com/compiler-explorer/opt/gcc-5.4.0.tar.xz" -o /tmp/gcc.tar.xz;
310+
cd ~;
311+
tar xvf /tmp/gcc.tar.xz
312+
313+
- name: Store gcc-5.4 to cache
314+
id: cache-gcc5
315+
if: always() && steps.restore-gcc5.outputs.cache-hit != 'true'
316+
uses: actions/cache/save@v4
317+
with:
318+
key: ce-tar-gcc-5
319+
path: ~/gcc-5.4.0/
320+
302321
- name: Make Source Read-Only
303322
run: chmod -R a-w ./*
304323

305324
- name: Configure
306325
run: |
307326
mkdir -p gccrs-build;
308327
cd gccrs-build;
309-
../configure \
310-
CC='gcc-5' \
311-
CXX='g++-5' \
312-
--enable-languages=rust \
313-
--disable-bootstrap \
314-
--enable-multilib
328+
329+
# Add cargo to our path quickly
330+
. "$HOME/.cargo/env";
331+
332+
PATH=$HOME/gcc-5.4.0/bin:$PATH \
333+
../configure \
334+
--enable-languages=rust \
335+
--disable-bootstrap \
336+
--enable-multilib
315337
316338
- name: Build
317339
shell: bash
318340
run: |
319341
# Add cargo to our path quickly
320342
. "$HOME/.cargo/env";
321-
make -C gccrs-build -j $(nproc)
343+
PATH=$HOME/gcc-5.4.0/bin:$PATH \
344+
make -C gccrs-build -j $(nproc)
322345
323346
- name: Run Tests
324347
run: |
325348
cd gccrs-build; \
326-
make check-rust RUNTESTFLAGS="--target_board=unix\{-m32,-m64}"
349+
PATH=$HOME/gcc-5.4.0/bin:$PATH \
350+
make check-rust RUNTESTFLAGS="--target_board=unix\{-m32,-m64}"
327351
328352
- name: Archive check-rust results
329353
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)