mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 12:57:41 +00:00
ci: use cargo-cross for multi-arch testing
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6f5fac0de48162e114976da3aa5adf216a6a6964
This commit is contained in:
parent
1c781aff56
commit
0d4377ffca
1 changed files with 9 additions and 22 deletions
31
.github/workflows/rust.yml
vendored
31
.github/workflows/rust.yml
vendored
|
|
@ -12,15 +12,14 @@ env:
|
|||
jobs:
|
||||
test:
|
||||
name: Test on ${{ matrix.target }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-gnu
|
||||
- riscv64gc-unknown-linux-gnu
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
|
|
@ -31,24 +30,12 @@ jobs:
|
|||
with:
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: "Install cross-compilation tools"
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
|
||||
- name: "Configure linker for aarch64"
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: |
|
||||
mkdir -p .cargo
|
||||
cat >> .cargo/config.toml << EOF
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
linker = "aarch64-linux-gnu-gcc"
|
||||
EOF
|
||||
- name: "Install cross"
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: "Build"
|
||||
run: cargo build --verbose --target ${{ matrix.target }}
|
||||
run: cross build --verbose --target ${{ matrix.target }}
|
||||
|
||||
- name: "Run tests"
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||
run: cargo test --verbose --target ${{ matrix.target }}
|
||||
run: cross test --verbose --target ${{ matrix.target }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue