@@ -13,35 +13,82 @@ defaults:
1313 shell : bash
1414
1515jobs :
16- build :
16+ test :
17+ name : test (${{ matrix.host_target }})
1718 strategy :
1819 fail-fast : false
1920 matrix :
2021 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
2748 runs-on : ${{ matrix.os }}
2849 env :
2950 HOST_TARGET : ${{ matrix.host_target }}
3051 steps :
3152 - 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')
3266 - uses : ./.github/workflows/setup
3367 with :
3468 toolchain_flags : " --host ${{ matrix.host_target }}"
3569
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
4180
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 }}
4385 run : ./ci/ci.sh
4486
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+
4592 style :
4693 name : style checks
4794 runs-on : ubuntu-latest
5198
5299 - name : rustfmt
53100 run : ./miri fmt --check
54- - name : clippy
55- run : ./miri clippy -- -D warnings
56101 - name : clippy (no features)
57102 run : ./miri clippy --no-default-features -- -D warnings
58103 - name : clippy (all features)
73118 # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
74119 # And they should be added below in `cron-fail-notify` as well.
75120 conclusion :
76- needs : [build , style, coverage]
121+ needs : [test , style, coverage]
77122 # We need to ensure this job does *not* get skipped if its dependencies fail,
78123 # because a skipped job is considered a success by GitHub. So we have to
79124 # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -135,7 +180,7 @@ jobs:
135180 cron-fail-notify :
136181 name : cronjob failure notification
137182 runs-on : ubuntu-latest
138- needs : [build , style, coverage]
183+ needs : [test , style, coverage]
139184 if : ${{ github.event_name == 'schedule' && failure() }}
140185 steps :
141186 # Send a Zulip notification
0 commit comments