name: Cross compile
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-musl
- armv5te-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- s390x-unknown-linux-gnu
- loongarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.arch }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target ${{ matrix.arch }}