-
Notifications
You must be signed in to change notification settings - Fork 124
72 lines (57 loc) · 2.5 KB
/
Copy pathtest-rust.yml
File metadata and controls
72 lines (57 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Test Rust
on:
pull_request:
branches: ["main", "main-*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test_rust:
name: Test Rust
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Print Machine Specs
shell: bash
run: |
echo "::group::Machine Information"
uname -a || true
cat /proc/cpuinfo 2>/dev/null | head -30 || sysctl -a machdep.cpu 2>/dev/null | head -30 || wmic cpu get Name,NumberOfCores,MaxClockSpeed 2>/dev/null || true
free -h 2>/dev/null || vm_stat 2>/dev/null || systeminfo 2>/dev/null | head -20 || true
echo "::endgroup::"
- name: Install Rust Toolchain
uses: moonrepo/setup-rust@v1
- name: Install Cross-Compilation Targets and Dependencies
run: |
rustup target add i686-unknown-linux-gnu
rustup target add armv7-unknown-linux-gnueabihf
sudo dpkg --add-architecture i386
sudo apt-get update
# Install i686 multilib and ARM cross-compiler separately to avoid
# gcc-multilib vs gcc-arm-linux-gnueabihf package conflicts.
sudo apt-get install -y gcc-multilib g++-multilib libc6-dev-i386
sudo apt-get install -y gcc-14-arm-linux-gnueabihf
- name: Test Default Build
run: cargo test
- name: Test with All Features
run: cargo test --all-features
- name: Test No-Std Build (Check Only)
run: cargo check --no-default-features
- name: Test i686 Cross-Compilation Build
run: cargo build --target i686-unknown-linux-gnu --features std
- name: Test i686 Cross-Compilation (No-Std)
run: cargo build --target i686-unknown-linux-gnu --no-default-features
# 32-bit ARM — catches AArch64-only intrinsics leaking into NEON paths
- name: Test ARMv7 Cross-Compilation Build
env:
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc-14
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc-14
run: cargo build --target armv7-unknown-linux-gnueabihf --features std
- name: Test ARMv7 Cross-Compilation (No-Std)
env:
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc-14
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc-14
run: cargo build --target armv7-unknown-linux-gnueabihf --no-default-features