From 71824b095c4150b3af0776ac158795c00ff9d53f Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 27 Jan 2025 18:58:12 +0900 Subject: [PATCH] ci: test AArch64 and run tests instead of build in cross job (#763) --- .github/workflows/ci.yml | 37 ++++++++++++++++++------------------- tests/test_bytes.rs | 1 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc868bbbc..6973ccd55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-22.04-arm # TODO: update to 24.04 when https://github.com/rust-lang/rust/issues/135867 solved - macos-latest - windows-latest runs-on: ${{ matrix.os }} @@ -104,29 +105,27 @@ jobs: name: cross strategy: matrix: - target: - - i686-unknown-linux-gnu - - armv7-unknown-linux-gnueabihf - - powerpc-unknown-linux-gnu - - powerpc64-unknown-linux-gnu - - wasm32-unknown-unknown - runs-on: ubuntu-latest + include: + - target: i686-unknown-linux-gnu + os: ubuntu-latest + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-22.04-arm # TODO: update to 24.04 when https://github.com/rust-lang/rust/issues/135867 solved + - target: powerpc-unknown-linux-gnu + os: ubuntu-latest + - target: powerpc64-unknown-linux-gnu + os: ubuntu-latest + - target: wasm32-wasip1 + os: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - - name: Install cross - uses: taiki-e/install-action@cross - if: matrix.target != 'wasm32-unknown-unknown' - - name: cross build --target ${{ matrix.target }} - run: cross build --target ${{ matrix.target }} - if: matrix.target != 'wasm32-unknown-unknown' - # WASM support - - name: cargo build --target ${{ matrix.target }} - run: | - rustup target add ${{ matrix.target }} - cargo build --target ${{ matrix.target }} - if: matrix.target == 'wasm32-unknown-unknown' + - uses: taiki-e/setup-cross-toolchain-action@v1 + with: + target: ${{ matrix.target }} + - name: Test + run: cargo test --target ${{ matrix.target }} # Sanitizers tsan: diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index 6ab418329..c283a8081 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -728,6 +728,7 @@ fn advance_past_len() { // Only run these tests on little endian systems. CI uses qemu for testing // big endian... and qemu doesn't really support threading all that well. #[cfg(any(miri, target_endian = "little"))] +#[cfg(not(target_family = "wasm"))] // wasm without experimental threads proposal doesn't support threads fn stress() { // Tests promoting a buffer from a vec -> shared in a concurrent situation use std::sync::{Arc, Barrier};