Skip to content

Commit

Permalink
ci: migrate aarch64/Linux CI to GA (#2600)
Browse files Browse the repository at this point in the history
* ci: migrate aarch64/Linux CI to GA

* test: skip test_af_alg_cipher() on aarch64/Linux
  • Loading branch information
SteveLauC authored Feb 6, 2025
1 parent 746cb95 commit 003bfe4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 34 deletions.
21 changes: 0 additions & 21 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,3 @@ task:
- . $HOME/.cargo/env
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Tasks for Linux aarch64 native builds
task:
matrix:
- name: Linux aarch64 gnu
arm_container:
image: rust:1.69.0
cpu: 1
env:
TARGET: aarch64-unknown-linux-gnu
- name: Linux aarch64 musl
arm_container:
image: rust:1.69.0
cpu: 1
env:
TARGET: aarch64-unknown-linux-musl
setup_script:
- rustup target add $TARGET
- rustup component add clippy
<< : *TEST
before_cache_script: rm -rf $CARGO_HOME/registry/index
48 changes: 42 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
# would fail on 22.04 and 24.04 (at least for now)
# https://github.com/nix-rust/nix/issues/2418
runs-on: ubuntu-20.04
needs: [rustfmt, minver, macos, linux_native_builds, rust_stable]
needs: [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -141,9 +141,8 @@ jobs:



# Tasks for Linux native builds
# Only test x86_64 targets on GitHub Action, leave aarch64 one in Cirrus CI.
linux_native_builds:
# Tasks for x86_64 Linux native builds
x86_64_linux_native_builds:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -178,6 +177,43 @@ jobs:

- name: before_cache_script
run: sudo rm -rf $CARGO_HOME/registry/index;

# Tasks for aarch64 Linux native builds
aarch64_linux_native_builds:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
target: [
aarch64-unknown-linux-gnu,
aarch64-unknown-linux-musl,
]

steps:
- name: checkout
uses: actions/checkout@v4

- name: setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: '${{ env.MSRV }}'
components: clippy

- name: install targets
run: rustup target add ${{ matrix.target }}

- name: build
uses: ./.github/actions/build
with:
TARGET: '${{ matrix.TARGET }}'

- name: test
uses: ./.github/actions/test
with:
TARGET: '${{ matrix.TARGET }}'

- name: before_cache_script
run: sudo rm -rf $CARGO_HOME/registry/index;

rust_stable:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -210,7 +246,7 @@ jobs:
# Tasks for cross-compiling, but no testing
cross_compiling:
runs-on: ubuntu-latest
needs: [rustfmt, minver, macos, linux_native_builds, rust_stable]
needs: [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable]
env:
BUILD: check
strategy:
Expand Down Expand Up @@ -269,7 +305,7 @@ jobs:

redox:
runs-on: ubuntu-latest
needs: [rustfmt, minver, macos, linux_native_builds, rust_stable]
needs: [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable]
env:
TARGET: x86_64-unknown-redox
CLIPPYFLAGS: -D warnings
Expand Down
15 changes: 8 additions & 7 deletions test/sys/test_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,15 @@ pub fn test_scm_rights() {
close(received_r).unwrap();
}

// Disable the test on emulated platforms due to not enabled support of AF_ALG in QEMU from rust cross
// 1. Disable the test on emulated platforms due to not enabled support of
// AF_ALG in QEMU from rust cross
// 2. Disable the test on aarch64/Linux CI because bind() fails with ENOENT
// https://github.com/nix-rust/nix/issues/1352
#[cfg(linux_android)]
#[cfg_attr(qemu, ignore)]
#[cfg_attr(
any(qemu, all(target_os = "linux", target_arch = "aarch64")),
ignore
)]
#[test]
pub fn test_af_alg_cipher() {
use nix::sys::socket::sockopt::AlgSetKey;
Expand All @@ -930,11 +936,6 @@ pub fn test_af_alg_cipher() {
use nix::unistd::read;
use std::io::IoSlice;

skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352");
// Travis's seccomp profile blocks AF_ALG
// https://docs.docker.com/engine/security/seccomp/
skip_if_seccomp!(test_af_alg_cipher);

let alg_type = "skcipher";
let alg_name = "ctr-aes-aesni";
// 256-bits secret key
Expand Down

0 comments on commit 003bfe4

Please sign in to comment.