name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
CXX: g++
jobs:
lint-test:
name: Rust ${{ matrix.toolchain }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta, nightly]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: cargo fmt --check
if: matrix.toolchain == 'stable'
run: cargo fmt --all -- --check
- name: cargo clippy (all features)
run: cargo clippy --locked --all-targets --all-features -- -D warnings
- name: cargo test (all features)
run: cargo test --locked --all --all-features
- name: cargo clippy (default features)
if: matrix.toolchain == 'stable'
run: cargo clippy --locked --all-targets -- -D warnings
- name: cargo test (default features)
if: matrix.toolchain == 'stable'
run: cargo test --locked
msrv:
name: MSRV (Rust 1.96.1)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++
- name: Install Rust 1.96.1
uses: dtolnay/rust-toolchain@1.96.1
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: cargo check (all features)
run: cargo check --locked --all-targets --all-features
- name: cargo check (default features)
run: cargo check --locked --all-targets
big-endian:
name: Big-endian (s390x)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Install cross
run: cargo install cross --locked --version 0.2.5
- name: cargo test on s390x (big-endian)
run: cross test --locked --target s390x-unknown-linux-gnu --features num-complex