1
1
name : CI - Unix
2
2
3
- permissions :
4
- contents : read
5
-
6
3
on :
7
4
pull_request :
8
5
paths :
@@ -19,128 +16,113 @@ on:
19
16
- master
20
17
21
18
jobs :
22
- build-native :
23
- runs-on : ubuntu-22.04
24
- name : build-${{ matrix.toolchain.compiler }}-${{ matrix.target.arch }}${{ matrix.optimization.CFLAGS }}
25
-
19
+ build :
20
+ runs-on : ubuntu-latest
21
+ name : build-${{ join(matrix.*, ' ') }}
26
22
strategy :
27
23
fail-fast : false
28
24
matrix :
29
- target :
30
- - { arch: i686, triple: i686-pc-linux-gnu, CFLAGS: -m32 }
31
- - { arch: x86_64, triple: x86_64-pc-linux-gnu, CFLAGS: }
32
- toolchain :
33
- - { compiler: gcc, CC: gcc-12, CXX: g++-12 }
34
- - { compiler: clang, CC: clang-13, CXX: clang++-13 }
35
- optimization :
36
- - { CFLAGS: -O0 }
37
- - { CFLAGS: -O3 }
25
+ HOST :
26
+ - x86_64-linux-gnu
27
+ - x86-linux-gnu
28
+ - arm-linux-gnueabihf
29
+ - aarch64-linux-gnu
30
+ - mipsel-linux-gnu
31
+ - powerpc64-linux-gnu
32
+ OPT :
33
+ - O0
34
+ - O3
38
35
steps :
39
- - uses : actions/checkout@v3
40
-
36
+ - uses : actions/checkout@v2
41
37
- name : Setup
42
- if : ${{ matrix.target.arch }} = 'i686'
43
38
run : |
44
- sudo apt update
45
- sudo apt install -y g++-12-multilib
46
-
39
+ HOST=${{ matrix.HOST }}
40
+ if [ $HOST = 'x86-linux-gnu' ]; then
41
+ sudo apt-get update
42
+ sudo apt-get install -yqq -o=Dpkg::Use-Pty=0 g++-multilib
43
+ elif [ $HOST != 'x86_64-linux-gnu' ]; then
44
+ sudo apt-get update
45
+ sudo apt-get install -yqq -o=Dpkg::Use-Pty=0 g++-$HOST
46
+ fi
47
47
- name : Configure
48
48
run : |
49
49
set -x
50
+ HOST=${{ matrix.HOST }}
51
+ BUILD=x86_64-linux-gnu
52
+ if [ $HOST = 'x86-linux-gnu' ]; then
53
+ CFLAGS="-m32"
54
+ CXXFLAGS="-m32"
55
+ BUILD=x86-linux-gnu
56
+ fi
57
+ export CFLAGS="$CFLAGS -${{ matrix.OPT }}"
58
+ export CXXFLAGS="$CXXFLAGS -${{ matrix.OPT}}"
50
59
autoreconf -i
51
- ./configure --build=x86_64-pc-linux-gnu --host=${{ matrix.target.triple }}
52
- env :
53
- CC : ${{ matrix.toolchain.CC }}
54
- CXX : ${{ matrix.toolchain.CXX }}
55
- CFLAGS : " ${{ matrix.target.CFLAGS }} ${{ matrix.optimization.CFLAGS }} -Wall -Wextra"
56
- CXXFLAGS : " ${{ matrix.target.CFLAGS }} ${{ matrix.optimization.CFLAGS }} -Wall -Wextra"
57
- LDFLAGS : ${{ matrix.target.CFLAGS }}
58
-
59
- - name : Build
60
- run : |
60
+ ./configure --build=$BUILD --host=$HOST
61
61
make -j8
62
-
63
62
- name : Test (native)
64
- if : ${{ success() }}
63
+ if : ${{ success() && (matrix.HOST == 'x86_64-linux-gnu' || matrix.HOST == 'x86-linux-gnu') }}
65
64
run : |
66
65
set -x
67
66
sudo bash -c 'echo core.%p.%p > /proc/sys/kernel/core_pattern'
68
67
ulimit -c unlimited
69
- make check -j8
70
-
68
+ make check -j32
71
69
- name : Show Logs
72
70
if : ${{ failure() }}
73
71
run : |
74
72
cat tests/test-suite.log 2>/dev/null
75
73
76
- build-cross :
77
- runs-on : ubuntu-22.04
78
- name : build-cross-${{ matrix.config.target }}
74
+ build-cross-qemu :
75
+ runs-on : ubuntu-latest
76
+ name : build-cross-qemu- ${{ matrix.config.target }}
79
77
80
78
strategy :
81
79
fail-fast : false
82
80
matrix :
83
81
config :
84
- - {target: arm, host: arm-linux-gnueabi, qemu : arm, gccver: 12 }
85
- - {target: armhf, host: arm-linux-gnueabihf, qemu : arm, gccver: 12 }
86
- - {target: aarch64, host: aarch64-linux-gnu, qemu : aarch64, gccver: 12 }
87
- - {target: riscv64, host: riscv64-linux-gnu, qemu : riscv64, gccver: 12 }
88
- - {target: ppc, host: powerpc-linux-gnu, qemu: ppc , gccver: 12 }
89
- - {target: ppc64, host: powerpc64-linux-gnu, qemu: ppc64 , gccver: 12 }
90
- - {target: ppc64le, host: powerpc64le-linux-gnu, qemu: ppc64le , gccver: 12 }
91
- - {target: s390x, host: s390x-linux-gnu, qemu : s390x, gccver: 12 }
92
- - {target: mips, host: mips-linux-gnu, qemu : mips, gccver: 10 }
93
- - {target: mips64, host: mips64-linux-gnuabi64, qemu : mips64, gccver: 10 }
94
- - {target: mipsel, host: mipsel-linux-gnu, qemu : mipsel, gccver: 10 }
95
- - {target: mips64el, host: mips64el-linux-gnuabi64, qemu : mips64el, gccver: 10 }
82
+ - {target: arm, toolchain: g++- arm-linux-gnueabi, host : arm-linux-gnueabi , qemu: arm }
83
+ - {target: armhf, toolchain: g++- arm-linux-gnueabihf, host : arm-linux-gnueabihf , qemu: arm }
84
+ - {target: aarch64, toolchain: g++- aarch64-linux-gnu, host : aarch64-linux-gnu , qemu: aarch64 }
85
+ - {target: riscv64, toolchain: g++- riscv64-linux-gnu, host : riscv64-linux-gnu , qemu: riscv64 }
86
+ - {target: ppc, toolchain: g++- powerpc-linux-gnu, host: powerpc-linux-gnu , qemu: ppc }
87
+ - {target: ppc64, toolchain: g++- powerpc64-linux-gnu, host: powerpc64-linux-gnu , qemu: ppc64 }
88
+ - {target: ppc64le, toolchain: g++- powerpc64le-linux-gnu, host: powerpc64le-linux-gnu , qemu: ppc64le }
89
+ - {target: s390x, toolchain: g++- s390x-linux-gnu, host : s390x-linux-gnu , qemu: s390x }
90
+ - {target: mips, toolchain: g++- mips-linux-gnu, host : mips-linux-gnu , qemu: mips }
91
+ - {target: mips64, toolchain: g++- mips64-linux-gnuabi64, host : mips64-linux-gnuabi64 , qemu: mips64 }
92
+ - {target: mipsel, toolchain: g++- mipsel-linux-gnu, host : mipsel-linux-gnu , qemu: mipsel }
93
+ - {target: mips64el,toolchain: g++- mips64el-linux-gnuabi64, host : mips64el-linux-gnuabi64,qemu: mips64el }
96
94
97
95
steps :
98
- - uses : actions/checkout@v3
96
+ - uses : actions/checkout@v2
99
97
- name : Install QEMU
100
98
# this ensure install latest qemu on ubuntu, apt get version is old
101
99
env :
102
100
QEMU_SRC : " http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
103
- QEMU_VER : " qemu-user-static_7 \\ .2.*_amd64.deb$"
101
+ QEMU_VER : " qemu-user-static_4 \\ .2- .*_amd64.deb$"
104
102
run : |
105
103
DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
106
104
wget $QEMU_SRC/$DEB
107
105
sudo dpkg -i $DEB
108
-
109
- - name : Install ${{ matrix.config.host }} Toolchain
106
+ - name : Install ${{ matrix.config.toolchain }}
110
107
run : |
111
108
sudo apt update
112
- sudo apt install g++-${{ matrix.config.gccver }}-${{ matrix.config.host }} -y
113
-
109
+ sudo apt install ${{ matrix.config.toolchain }} -y
114
110
- name : Configure with ${{ matrix.config.cc }}
115
111
run : |
116
112
set -x
117
113
autoreconf -i
118
114
BUILD=x86_64-linux-gnu
119
- ./configure --build=$BUILD --host=${{ matrix.config.host }} --with-testdriver=$(pwd)/scripts/qemu-test-driver --enable-debug
120
- env :
121
- CC : ${{ matrix.config.host }}-gcc-${{ matrix.config.gccver }}
122
- CXX : ${{ matrix.config.host }}-g++-${{ matrix.config.gccver }}
123
-
115
+ ./configure --build=$BUILD --host=${{ matrix.config.host }} --with-testdriver=$(pwd)/scripts/qemu-test-driver
124
116
- name : Build
125
117
run : |
126
118
make -j8
127
- env :
128
- CFLAGS : " -Wall -Wextra"
129
-
130
- - name : ABI Check
131
- run : |
132
- cd tests && ./run-check-namespace
133
-
134
119
- name : Test
135
120
run : |
136
121
set -x
137
122
sudo bash -c 'echo core.%p.%p > /proc/sys/kernel/core_pattern'
138
123
ulimit -c unlimited
139
124
CROSS_LIB="/usr/${{ matrix.config.host }}"
140
125
make -j8 check LOG_DRIVER_FLAGS="--qemu-arch ${{ matrix.config.qemu }}" LDFLAGS="-L$CROSS_LIB/lib -static" QEMU_LD_PREFIX="$CROSS_LIB"
141
- env :
142
- UNW_DEBUG_LEVEL : 4
143
-
144
126
- name : Show Logs
145
127
if : ${{ failure() }}
146
128
run : |
0 commit comments