mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 21:07: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:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test on ${{ matrix.target }}
|
name: Test on ${{ matrix.target }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
target:
|
||||||
- os: ubuntu-latest
|
- x86_64-unknown-linux-gnu
|
||||||
target: x86_64-unknown-linux-gnu
|
- aarch64-unknown-linux-gnu
|
||||||
- os: ubuntu-latest
|
- riscv64gc-unknown-linux-gnu
|
||||||
target: aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
|
|
@ -31,24 +30,12 @@ jobs:
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
- name: "Install cross-compilation tools"
|
- name: "Install cross"
|
||||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
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: "Build"
|
- name: "Build"
|
||||||
run: cargo build --verbose --target ${{ matrix.target }}
|
run: cross build --verbose --target ${{ matrix.target }}
|
||||||
|
|
||||||
- name: "Run tests"
|
- name: "Run tests"
|
||||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
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