Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to work in no-std (optionally with alloc) #132

Merged
merged 4 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ on:
branches:
- master

env:
RUSTFLAGS: -A warnings

jobs:
test:
name: Test on ${{ matrix.os }} using Rust ${{ matrix.rust }} with bindgen features '${{ matrix.cargo_features }}'
name: Test on ${{ matrix.os }} using Rust ${{ matrix.rust }} with features '${{ matrix.cargo_features }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]
cargo_features: ['']
cargo_features: ['', 'alloc', 'default']

steps:
- uses: hecrj/setup-rust-action@v2
Expand All @@ -44,33 +41,20 @@ jobs:
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly'

- name: Cargo clippy
run: cargo +${{ matrix.rust }} clippy --all-targets --workspace --features "${{ matrix.cargo_features }}"
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' && matrix.cargo_features != ''

- name: Cargo clippy
run: cargo +${{ matrix.rust }} clippy --all-targets --workspace
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' && matrix.cargo_features == ''

- name: Build
run: cargo +${{ matrix.rust }} build --features "${{ matrix.cargo_features }}"
if: matrix.cargo_features != ''

- name: Build
run: cargo +${{ matrix.rust }} build
if: matrix.cargo_features == ''

- name: Test
run: cargo +${{ matrix.rust }} test --features "${{ matrix.cargo_features }}"
if: matrix.cargo_features != ''
run: cargo +${{ matrix.rust }} clippy --all-targets --workspace --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' && matrix.cargo_features == 'default'

- name: Test
run: cargo +${{ matrix.rust }} test
if: matrix.cargo_features == ''
run: cargo +${{ matrix.rust }} test --no-default-features --features "${{ matrix.cargo_features }}"

- name: Benchmark
if: matrix.rust == 'nightly'
run: cargo +${{ matrix.rust }} bench
run: cargo +${{ matrix.rust }} bench --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'nightly' && matrix.cargo_features == 'default'

- name: Minimal versions
if: matrix.rust == 'nightly'
run: cargo +${{ matrix.rust }} -Zdirect-minimal-versions test
run: cargo +${{ matrix.rust }} -Zdirect-minimal-versions test --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'nightly' && matrix.cargo_features == 'default'

- name: Updated versions
run: cargo update && cargo +${{ matrix.rust }} test --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'stable' && matrix.cargo_features == 'default'
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target
Cargo.lock
.DS_Store
.idea
Loading
Loading