diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b1ca465..211a546 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,9 +1,9 @@ name: Rust CI on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: build: runs-on: ubuntu-latest @@ -45,6 +45,31 @@ jobs: - name: Cargo check run: cargo check --features "${{ matrix.feature }}" --no-default-features + other_archs: + # github actions does not support 32-bit or big endian systems directly, but + # it does support QEMU. so we install qemu, then build and run the tests on + # emulated systems. NOTE: you can also use this approach to test locally. + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: [powerpc-unknown-linux-gnu, i686-unknown-linux-gnu] + steps: + - uses: actions/checkout@v4 + - name: Install or use cached cross-rs/cross + uses: baptiste0928/cargo-install@v2 + with: + crate: cross + - name: Cache Cargo Dependencies + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + key: ${{ matrix.arch }} + - name: Start Docker (required for cross-rs) + run: sudo systemctl start docker + - name: Cross-Run Tests using QEMU + run: cross test --target ${{ matrix.arch }} + rustfmt: runs-on: ubuntu-latest steps: