Skip to content

Commit

Permalink
use cross
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Jan 3, 2024
1 parent bcf11d7 commit 62c7409
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,34 @@ jobs:
run: cargo clippy

build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.target }}
runs-on: ubuntu-latest
needs: [ format_and_lint ]
strategy:
fail-fast: false
matrix:
include:
- { name: "Linux-x86_64-musl", target: x86_64-unknown-linux-musl, os: ubuntu-latest, use-cross: true }
- { name: "Linux-x86_64-gnu", target: x86_64-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-aarch64-musl", target: aarch64-unknown-linux-musl, os: ubuntu-latest, use-cross: true }
- { name: "Linux-aarch64-gnu", target: aarch64-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-arm-musl", target: arm-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true }
- { name: "Linux-arm-gnu", target: arm-unknown-linux-gnueabi, os: ubuntu-latest, use-cross: true }
- { name: "Linux-powerpc64-gnu", target: powerpc64-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-powerpc64le-gnu", target: powerpc64le-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-s390x-gnu", target: s390x-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { target: x86_64-unknown-linux-musl }
- { target: x86_64-unknown-linux-gnu }
- { target: aarch64-unknown-linux-musl }
- { target: aarch64-unknown-linux-gnu }
- { target: arm-unknown-linux-musleabi }
- { target: arm-unknown-linux-gnueabi }
- { target: powerpc64-unknown-linux-gnu }
- { target: powerpc64le-unknown-linux-gnu }
- { target: s390x-unknown-linux-gnu }
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: recursive
lfs: ${{ !matrix.skip-tests }}

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
components: rustfmt
cache: false

- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: Install cross
uses: taiki-e/install-action@cross

- uses: Swatinem/rust-cache@v2

Expand All @@ -77,10 +72,6 @@ jobs:
cargo -V
rustc -V
- name: Build
run: cargo build

- name: Run tests
if: ${{ !matrix.skip-tests }}
run: >
cargo test -- --nocapture
cross test -- --nocapture

0 comments on commit 62c7409

Please sign in to comment.