Skip to content

Commit ac4767a

Browse files
committed
ci: test
1 parent f942905 commit ac4767a

File tree

2 files changed

+462
-433
lines changed

2 files changed

+462
-433
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: 'Build GCC'
2+
description: 'Builds GCC with Rust enabled'
3+
inputs:
4+
extra-configure-env:
5+
description: 'Extra env for configure'
6+
required: false
7+
default: ''
8+
9+
run_test_flags:
10+
description: 'Args for RUN_TEST_FLAGS'
11+
required: true
12+
13+
warning_file:
14+
description: 'Filename with expected warnings'
15+
required: true
16+
17+
# outputs:
18+
# random-number:
19+
# description: "Random number"
20+
# value: ${{ steps.random-number-generator.outputs.random-number }}
21+
runs:
22+
using: "composite"
23+
steps:
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update;
27+
sudo apt-get install -y \
28+
automake \
29+
autoconf \
30+
libtool \
31+
autogen \
32+
bison \
33+
flex \
34+
libgmp3-dev \
35+
libmpfr-dev \
36+
libmpc-dev \
37+
build-essential \
38+
gcc-multilib \
39+
g++-multilib \
40+
dejagnu;
41+
# install Rust directly using rustup
42+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
43+
shell: bash
44+
45+
- name: Make Source Read-Only
46+
run: chmod -R a-w ./*
47+
shell: bash
48+
49+
- name: Configure GCC
50+
run: |
51+
mkdir -p gccrs-build;
52+
cd gccrs-build;
53+
${{ inputs.extra-configure-env }}
54+
../configure \
55+
--enable-languages=rust \
56+
--disable-bootstrap \
57+
--enable-multilib
58+
59+
- name: Build GCC
60+
shell: bash
61+
run: |
62+
cd gccrs-build; \
63+
# Add cargo to our path quickly
64+
. "$HOME/.cargo/env";
65+
make -Otarget -j $(nproc) 2>&1 | tee log
66+
67+
- name: Check for new warnings
68+
shell: bash
69+
run: |
70+
cd gccrs-build
71+
< log grep 'warning: ' | grep rust | sort > log_warnings
72+
if diff -U0 ../.github/${{ inputs.warning_file }} log_warnings; then
73+
:
74+
else
75+
echo 'See <https://github.com/Rust-GCC/gccrs/pull/1026>.'
76+
exit 1
77+
fi >&2
78+
79+
- name: Run Tests
80+
shell: bash
81+
run: |
82+
cd gccrs-build; \
83+
make check-rust RUNTESTFLAGS="${{ inputs.run_test_flags }}"
84+
85+
- name: Check regressions
86+
shell: bash
87+
run: |
88+
cd gccrs-build; \
89+
if grep -e "unexpected" -e "unresolved" -e "ERROR:" gcc/testsuite/rust/rust.sum;\
90+
then \
91+
echo "::error title=Regression test failed::some tests are not correct"; \
92+
perl -n ../.github/emit_test_errors.pl < gcc/testsuite/rust/rust.sum; \
93+
exit 1; \
94+
else \
95+
exit 0; \
96+
fi

0 commit comments

Comments
 (0)