add the target to the cross invocation #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
name: Rust | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
RUST_LOG: info | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: "-D warnings" | |
CARGO_TERM_COLOR: always | |
jobs: | |
format_and_lint: | |
name: Format and Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: clippy, rustfmt | |
- name: Run rustfmt | |
uses: actions-rust-lang/rustfmt@v1 | |
- name: Run clippy | |
run: cargo clippy | |
build: | |
name: ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
needs: [ format_and_lint ] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { target: x86_64-unknown-linux-musl } | |
- { target: x86_64-unknown-linux-gnu } | |
- { target: aarch64-unknown-linux-musl } | |
- { target: aarch64-unknown-linux-gnu } | |
- { target: arm-unknown-linux-musleabi } | |
- { target: arm-unknown-linux-gnueabi } | |
- { target: powerpc64-unknown-linux-gnu } | |
- { target: powerpc64le-unknown-linux-gnu } | |
- { target: s390x-unknown-linux-gnu } | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.target }} | |
cache: false | |
- name: Install cross | |
uses: taiki-e/install-action@cross | |
- uses: Swatinem/rust-cache@v2 | |
- name: Show version information (Rust, cargo, GCC) | |
shell: bash | |
run: | | |
gcc --version || true | |
rustup -V | |
rustup toolchain list | |
cargo -V | |
rustc -V | |
cross -V | |
- name: Run tests | |
run: > | |
cross test --target ${{ matrix.target }} -- --nocapture |