microfetch/.github/workflows/rust.yml
NotAShelf 0d4377ffca
ci: use cargo-cross for multi-arch testing
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6f5fac0de48162e114976da3aa5adf216a6a6964
2026-03-27 15:21:47 +03:00

41 lines
917 B
YAML

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test on ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
steps:
- name: "Checkout"
uses: actions/checkout@v6
- name: "Setup Rust toolchain"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: "Install cross"
run: cargo install cross --git https://github.com/cross-rs/cross
- name: "Build"
run: cross build --verbose --target ${{ matrix.target }}
- name: "Run tests"
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cross test --verbose --target ${{ matrix.target }}