Skip to content

Enhancement #1 no_std support #17

Enhancement #1 no_std support

Enhancement #1 no_std support #17

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Code quality and integration checks
quality_and_integration:
name: Code Quality and Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: cargo-target-quality-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets
- name: Check documentation
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
- name: Test byten_derive
run: cargo test -p byten_derive
# Test different feature combinations
feature-matrix:
name: Test Feature Combinations
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- name: "no_std (core only)"
flags: "--no-default-features"
- name: "no_std + derive"
flags: "--no-default-features --features derive"
- name: "no_std + alloc"
flags: "--no-default-features --features alloc"
- name: "no_std + alloc + derive"
flags: "--no-default-features --features alloc,derive"
- name: "std only"
flags: "--no-default-features --features std"
- name: "std + derive"
flags: "--no-default-features --features std,derive"
- name: "all features"
flags: "--all-features"
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: cargo-target-${{ matrix.features.name }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build with ${{ matrix.features.name }}
run: cargo build ${{ matrix.features.flags }} -p byten
- name: Test with ${{ matrix.features.name }}
run: cargo test --lib ${{ matrix.features.flags }} -p byten
- name: Test doc examples with ${{ matrix.features.name }}
run: cargo test --doc ${{ matrix.features.flags }} -p byten