Skip to content

initial commit

initial commit #2

Workflow file for this run

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.name }}
runs-on: ${{ matrix.os }}
needs: [ format_and_lint ]
strategy:
fail-fast: false
matrix:
include:
- { name: "Linux-x86_64-musl", target: x86_64-unknown-linux-musl, os: ubuntu-latest }
- { name: "Linux-x86_64-gnu", target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
- { name: "Linux-aarch64-musl", target: aarch64-unknown-linux-musl, os: ubuntu-latest }
- { name: "Linux-aarch64-gnu", target: aarch64-unknown-linux-gnu, os: ubuntu-latest }
- { name: "Linux-arm-musl", target: arm-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true }
- { name: "Linux-arm-gnu", target: arm-unknown-linux-gnuabi, os: ubuntu-latest, use-cross: true }
- { name: "Linux-powerpc64-gnu", target: powerpc64-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-powerpc64le-gnu", target: powerpc64le-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
- { name: "Linux-s390x-gnu", target: s390x-unknown-linux-gnu, os: ubuntu-latest, use-cross: true }
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: recursive
lfs: ${{ !matrix.skip-tests }}
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
components: rustfmt
cache: false
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- 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
- name: Build
run: cargo build
- name: Run tests
if: ${{ !matrix.skip-tests }}
run: >
cargo test -- --nocapture