From 6436d1638324fb3fd8d744e2148a03b4a138a29b Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 17 Oct 2024 10:14:15 +1100 Subject: [PATCH] gha: test cross-compilation to other arches Signed-off-by: Aleksa Sarai --- .github/workflows/rust.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a190d64..a74a6c5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -57,6 +57,37 @@ jobs: toolchain: ${{ env.RUST_MSRV }} - run: cargo check --workspace --all-features --all-targets + check-cross: + strategy: + fail-fast: false + matrix: + target: + - x86_64-unknown-linux-musl + - aarch64-unknown-linux-musl + - arm-unknown-linux-gnueabi + - arm-unknown-linux-gnueabihf + - armv7-unknown-linux-gnueabihf + - i686-unknown-linux-gnu + - powerpc-unknown-linux-gnu + - powerpc64-unknown-linux-gnu + - powerpc64le-unknown-linux-gnu + - riscv64gc-unknown-linux-gnu + - sparc64-unknown-linux-gnu + - s390x-unknown-linux-gnu + env: + CARGO_FLAGS: --target ${{ matrix.target }} + name: cargo check (${{ matrix.target }}) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + # TODO: Should we use MSRV for this? + targets: ${{ matrix.target }} + - run: cargo check $CARGO_FLAGS --workspace --all-features --all-targets + - run: make release + - run: file target/release/libpathrs.* + rustdoc: name: cargo doc runs-on: ubuntu-latest @@ -132,6 +163,7 @@ jobs: needs: - check - check-msrv + - check-cross - rustdoc - test - examples @@ -155,6 +187,7 @@ jobs: needs: - check - check-msrv + - check-cross - rustdoc - test - examples