Skip to content

workflows: style: fix indention #271

workflows: style: fix indention

workflows: style: fix indention #271

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '34 11 * * 2'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Make sure cargo commands not only fail on hard errors but also on warnings
# so we do not accidentally miss newly introduced warnings.
RUSTFLAGS: -D warnings
jobs:
build-and-test:
strategy:
fail-fast: false # Run against all versions even if one fails
matrix:
version:
- "1.75" # Yocto scarthgap
- "1.81" # OSELAS.Toolchain v2024.11.0
- "1.84" # Yocto walnascar
- "stable"
- "nightly"
name: cargo build && cargo test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v5
with:
path: |
~/.cargo/
target/
key: ${{ runner.os }}-cargo-${{ matrix.version }}-${{ hashFiles('**/Cargo.lock') }}
- run: rustup toolchain install ${{ matrix.version }}
- run: rustup default ${{ matrix.version }}
- run: cargo build --all-targets --all-features --verbose
- run: cargo test --all-targets --all-features --verbose
features:
name: feature combinations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: test/features_combinations.py > feature-map
- uses: actions/cache@v5
with:
path: |
~/.cargo/
target/
key: ${{ runner.os }}-cargo-${{ matrix.version }}-${{ hashFiles('feature-map') }}-${{ hashFiles('**/Cargo.lock') }}
- run: rustup toolchain install stable
- run: |
while read features; do
echo "Features: ${features}"
RUSTFLAGS="-D warnings" cargo build --all-targets --no-default-features --features "${features}" &&
cargo test --all-targets --no-default-features --features "${features}" || exit
done < feature-map
integration:
name: integration test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add x86_64-unknown-linux-musl
- run: rustup toolchain install --target x86_64-unknown-linux-musl stable
- run: sudo apt-get update && sudo apt-get install python3-pytest qemu-system-x86 genimage
- run: pytest
clippy:
strategy:
matrix:
features:
- ""
- "--tests"
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable
- run: cargo clippy ${{ matrix.features }}
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly
- run: rustup component add --toolchain nightly rustfmt
- run: cargo +nightly fmt --all -- --check