@@ -13,35 +13,82 @@ defaults:
13
13
shell : bash
14
14
15
15
jobs :
16
- build :
16
+ test :
17
+ name : test (${{ matrix.host_target }})
17
18
strategy :
18
19
fail-fast : false
19
20
matrix :
20
21
include :
21
- - os : ubuntu-latest
22
- host_target : x86_64-unknown-linux-gnu
23
- - os : macos-14
24
- host_target : aarch64-apple-darwin
25
- - os : windows-latest
26
- host_target : i686-pc-windows-msvc
22
+ - host_target : x86_64-unknown-linux-gnu
23
+ os : ubuntu-latest
24
+ - host_target : i686-unknown-linux-gnu
25
+ os : ubuntu-latest
26
+ multiarch : i386
27
+ gcc_cross : i686-linux-gnu
28
+ - host_target : aarch64-unknown-linux-gnu
29
+ os : ubuntu-24.04-arm
30
+ - host_target : armv7-unknown-linux-gnueabihf
31
+ os : ubuntu-24.04-arm
32
+ multiarch : armhf
33
+ gcc_cross : arm-linux-gnueabihf
34
+ - host_target : riscv64gc-unknown-linux-gnu
35
+ os : ubuntu-latest
36
+ multiarch : riscv64
37
+ gcc_cross : riscv64-linux-gnu
38
+ qemu : true
39
+ - host_target : s390x-unknown-linux-gnu
40
+ os : ubuntu-latest
41
+ multiarch : s390x
42
+ gcc_cross : s390x-linux-gnu
43
+ qemu : true
44
+ - host_target : aarch64-apple-darwin
45
+ os : macos-latest
46
+ - host_target : i686-pc-windows-msvc
47
+ os : windows-latest
27
48
runs-on : ${{ matrix.os }}
28
49
env :
29
50
HOST_TARGET : ${{ matrix.host_target }}
30
51
steps :
31
52
- uses : actions/checkout@v4
53
+ - name : install qemu
54
+ if : ${{ matrix.qemu }}
55
+ run : sudo apt install qemu-user qemu-user-binfmt
56
+ - name : install multiarch
57
+ if : ${{ matrix.multiarch != '' }}
58
+ run : |
59
+ # s390x, ppc64el need Ubuntu Ports to be in the mirror list
60
+ sudo bash -c "echo 'https://ports.ubuntu.com/ priority:4' >> /etc/apt/apt-mirrors.txt"
61
+ # Add architecture
62
+ sudo dpkg --add-architecture ${{ matrix.multiarch }}
63
+ sudo apt update
64
+ # Install needed packages
65
+ sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
32
66
- uses : ./.github/workflows/setup
33
67
with :
34
68
toolchain_flags : " --host ${{ matrix.host_target }}"
35
69
36
- # The `style` job only runs on Linux; this makes sure the Windows-host-specific
37
- # code is also covered by clippy.
38
- - name : Check clippy
39
- if : ${{ matrix.os == 'windows-latest' }}
40
- run : ./miri clippy -- -D warnings
70
+ # We set up the cross-compiler *after* the basic setup as setting CC would otherwise
71
+ # cause confusion.
72
+ - name : install gcc-cross
73
+ if : ${{ matrix.gcc_cross != '' }}
74
+ run : |
75
+ sudo apt install gcc-${{ matrix.gcc_cross }}
76
+ echo "Setting environment variables:"
77
+ echo "CC_${{ matrix.host_target }}=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
78
+ TARGET_UPPERCASE=$(echo ${{ matrix.host_target }} | tr '[:lower:]-' '[:upper:]_')
79
+ echo "CARGO_TARGET_${TARGET_UPPERCASE}_LINKER=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
41
80
42
- - name : Test Miri
81
+ # The main test job! We don't run this in qemu as that is quite slow,
82
+ # so those targets only get the clippy check below.
83
+ - name : test Miri
84
+ if : ${{ !matrix.qemu }}
43
85
run : ./ci/ci.sh
44
86
87
+ # The `style` job only runs on Linux; this makes sure the host-specific
88
+ # code is also covered by clippy.
89
+ - name : clippy
90
+ run : ./miri clippy -- -D warnings
91
+
45
92
style :
46
93
name : style checks
47
94
runs-on : ubuntu-latest
51
98
52
99
- name : rustfmt
53
100
run : ./miri fmt --check
54
- - name : clippy
55
- run : ./miri clippy -- -D warnings
56
101
- name : clippy (no features)
57
102
run : ./miri clippy --no-default-features -- -D warnings
58
103
- name : clippy (all features)
73
118
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
74
119
# And they should be added below in `cron-fail-notify` as well.
75
120
conclusion :
76
- needs : [build , style, coverage]
121
+ needs : [test , style, coverage]
77
122
# We need to ensure this job does *not* get skipped if its dependencies fail,
78
123
# because a skipped job is considered a success by GitHub. So we have to
79
124
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -135,7 +180,7 @@ jobs:
135
180
cron-fail-notify :
136
181
name : cronjob failure notification
137
182
runs-on : ubuntu-latest
138
- needs : [build , style, coverage]
183
+ needs : [test , style, coverage]
139
184
if : ${{ github.event_name == 'schedule' && failure() }}
140
185
steps :
141
186
# Send a Zulip notification
0 commit comments