Skip to content

Commit 685cca9

Browse files
authored
run tests on linux arm ci pipeline (#2993)
* run tests on linux arm ci pipeline * exclude a test
1 parent 95b37e6 commit 685cca9

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ jobs:
180180
- name: Override rust toolchain
181181
run: rustup override set ${{ matrix.rust }}
182182

183+
- uses: taiki-e/install-action@nextest
184+
185+
# qemu runs the cross-compiled aarch64 test binaries; the aarch64 cross
186+
# runtime provides the sysroot qemu loads guest libs from; gpgsm is needed
187+
# by the x509 signing e2e test (ssh-keygen/gpg/openssl are preinstalled).
188+
- name: Install emulation and signing tools
189+
run: sudo apt-get update && sudo apt-get install -y qemu-user-static libc6-arm64-cross libgcc-s1-arm64-cross gpgsm
190+
183191
- name: Setup ARM toolchain
184192
run: |
185193
rustup target add aarch64-unknown-linux-gnu
@@ -201,6 +209,16 @@ jobs:
201209
- name: Build Debug
202210
run: |
203211
make build-linux-arm-debug
212+
213+
# Run the suite for aarch64 under emulation. qemu emulates the aarch64
214+
# test binary (loading its libs from the cross sysroot via -L) while
215+
# passing native x86 child processes (git, gpg, ssh-keygen, ...) straight
216+
# through to the host, so the signing e2e tests exercise the real tools.
217+
- name: Run tests (aarch64, emulated)
218+
env:
219+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER: qemu-aarch64-static -L /usr/aarch64-linux-gnu
220+
run: make test-linux-arm
221+
204222
- name: Build Release
205223
run: |
206224
make build-linux-arm-release

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ build-linux-musl-release:
6161
test-linux-musl:
6262
cargo nextest run --workspace --target=x86_64-unknown-linux-musl
6363

64+
# aarch64 test binaries are cross-compiled, so CI runs them under qemu via a
65+
# CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER (see .github/workflows/ci.yml).
66+
# Exclude test_hook_with_missing_shebang: it needs the kernel's ENOEXEC (so
67+
# gitui retries the hook via `sh`), which qemu-user doesn't emulate — the exec
68+
# just exits 127. It passes on real aarch64 hardware.
69+
test-linux-arm:
70+
cargo nextest run --workspace --target=aarch64-unknown-linux-gnu -E 'not test(test_hook_with_missing_shebang)'
71+
6472
release-linux-arm: build-linux-arm-release
6573
mkdir -p release
6674

0 commit comments

Comments
 (0)