@@ -335,19 +335,32 @@ jobs:
335335
336336 # Test runtime crates on multiple architectures to catch architecture-specific issues
337337 # like crc-fast 1.4 SIGILL on ARM before merge
338+ # Test runtime crates on multiple architectures to catch architecture-specific issues
339+ # like crc-fast 1.4 SIGILL on ARM. ARM targets run natively on ARM runners to avoid
340+ # QEMU emulation issues that may not accurately reproduce CPU feature detection bugs.
338341 test-runtime-architectures :
339342 name : Test Runtime (${{ matrix.target }})
340- runs-on : ubuntu-latest
343+ runs-on : ${{ matrix.runner }}
341344 permissions :
342345 contents : read
343346 strategy :
344347 fail-fast : false
345348 matrix :
346- target :
347- - x86_64-unknown-linux-gnu
348- - x86_64-unknown-linux-musl
349- - aarch64-unknown-linux-gnu
350- - aarch64-unknown-linux-musl
349+ include :
350+ # x86_64 targets - use cross only for musl
351+ - target : x86_64-unknown-linux-gnu
352+ runner : ubuntu-latest
353+ use_cross : false
354+ - target : x86_64-unknown-linux-musl
355+ runner : ubuntu-latest
356+ use_cross : true
357+ # ARM targets - run natively on ARM runners to catch real SIGILL
358+ - target : aarch64-unknown-linux-gnu
359+ runner : smithy_ubuntu-latest_8-core-arm
360+ use_cross : false
361+ - target : aarch64-unknown-linux-musl
362+ runner : smithy_ubuntu-latest_8-core-arm
363+ use_cross : true
351364 steps :
352365 - uses : actions/checkout@v4
353366 with :
@@ -359,19 +372,35 @@ jobs:
359372 - uses : Swatinem/rust-cache@v2
360373 with :
361374 key : ${{ matrix.target }}
362- - name : Install cross
375+ - name : Install cross (if needed)
376+ if : matrix.use_cross
363377 run : cargo install cross --locked --version 0.2.4
364- # Run tests instead of just building to catch runtime issues like SIGILL
378+ # Run tests natively on ARM to catch real SIGILL, not QEMU emulation
365379 - name : Test smithy-rs runtime on ${{ matrix.target }}
366380 shell : bash
367- run : cross test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --workspace --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental
381+ run : |
382+ if [ "${{ matrix.use_cross }}" = "true" ]; then
383+ cross test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --workspace --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental
384+ else
385+ cargo test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --workspace --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental
386+ fi
368387 - name : Test AWS runtime on ${{ matrix.target }}
369388 shell : bash
370- run : cross test --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --workspace
389+ run : |
390+ if [ "${{ matrix.use_cross }}" = "true" ]; then
391+ cross test --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --workspace
392+ else
393+ cargo test --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --workspace
394+ fi
371395 # Specifically test checksums crate which uses crc-fast
372396 - name : Test checksums on ${{ matrix.target }}
373397 shell : bash
374- run : cross test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" -p aws-smithy-checksums
398+ run : |
399+ if [ "${{ matrix.use_cross }}" = "true" ]; then
400+ cross test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" -p aws-smithy-checksums
401+ else
402+ cargo test --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" -p aws-smithy-checksums
403+ fi
375404
376405 # Run the canary against generated SDKs
377406 #
@@ -394,10 +423,10 @@ jobs:
394423 fail-fast : false
395424 matrix :
396425 include :
397- - arch : x86_64
398- runner : smithy_ubuntu-latest_8-core
399- - arch : aarch64
400- runner : smithy_ubuntu-latest_8-core-arm
426+ - arch : x86_64
427+ runner : smithy_ubuntu-latest_8-core
428+ - arch : aarch64
429+ runner : smithy_ubuntu-latest_8-core-arm
401430 steps :
402431 - uses : GitHubSecurityLab/actions-permissions/monitor@v1
403432 - uses : actions/checkout@v4
0 commit comments