microfetch/.github/workflows/rust.yml
2026-04-18 19:35:10 -04:00

59 lines
1.5 KiB
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:
include:
- target: x86_64-unknown-linux-gnu
toolchain: stable
- target: aarch64-unknown-linux-gnu
toolchain: stable
- target: riscv64gc-unknown-linux-gnu
toolchain: stable
- target: loongarch64-unknown-linux-gnu
toolchain: stable
- target: s390x-unknown-linux-gnu
toolchain: stable
# powerpc64 uses experimental asm features
- target: powerpc64le-unknown-linux-gnu
toolchain: nightly
- target: powerpc64-unknown-linux-gnu
toolchain: nightly
steps:
- name: "Checkout"
uses: actions/checkout@v6
- name: "Setup Rust toolchain"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
rustflags: ""
- name: "Make Mold the default linker"
uses: rui314/setup-mold@v1
- name: "Setup cross-compilation toolchain"
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: "Build"
run: cargo build --verbose
- name: "Run tests"
run: cargo test --workspace --exclude microfetch --verbose