From cb6edaf6049d921159e84f7c53f187c395b0c8f8 Mon Sep 17 00:00:00 2001 From: Erik Chi <59949156+erikziyunchi@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:59:48 -0500 Subject: [PATCH] update: try rust-cross --- .github/workflows/rust.yml | 70 +++++++++++++------------------------- 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bf10b76..5b758ff 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -71,52 +71,30 @@ jobs: - name: Test run: cargo test --verbose --workspace --all-features - test_linux-non-amd64: - name: rust (linux/${{ matrix.target }}) - # needs: test_amd64 + test_non-amd64: + name: rust (${{ matrix.platform.os_name }}/${{ matrix.toolchain }}) + runs-on: ${{ matrix.platform.os }} strategy: + fail-fast: false matrix: - rust: [ "stable" ] # specify the Rust versions you want to test - target: [ "aarch64", "riscv64gc" ] - runs-on: ubuntu-latest + platform: + - os_name: Linux-aarch64 + os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + - os_name: Linux-riscv64 + os: ubuntu-20.04 + target: riscv64gc-unknown-linux-gnu + - os_name: macOS-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + toolchain: + - stable steps: - - uses: actions/checkout@v4 - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true - # install wasm32-wasi target - - name: Add wasm32-wasi target - run: rustup target add wasm32-wasi - - name: Install QEMU - uses: docker/setup-qemu-action@v3 - - name: Test - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: test - args: --target ${{ matrix.target }}-unknown-linux-gnu --verbose --workspace --all-features - - test_macos-arm64: - name: rust (macos/arm64) - # needs: test_amd64 - strategy: - matrix: - rust: [ "stable" ] - runs-on: flyci-macos-large-latest-m1 # generously provided by www.flyci.net - steps: - - uses: actions/checkout@v4 - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - # install wasm32-wasi target - - name: Add wasm32-wasi target - run: rustup target add wasm32-wasi - - name: Test - run: cargo test --verbose --workspace --all-features \ No newline at end of file + - uses: actions/checkout@v4 + - name: Tests + uses: houseabsolute/actions-rust-cross@v0 # try rust-cross + with: + command: "test" + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--verbose --workspace --all-features" \ No newline at end of file