Fix no_std support & relax dependency version requirements #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: fmt | |
| run: cargo fmt --check --all --verbose | |
| clippy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: std | |
| args: "" | |
| - name: no-std | |
| args: "--no-default-features --features no_std" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: clippy (${{ matrix.name }}) | |
| run: cargo clippy --features evm,starknet,serde ${{ matrix.args }} --workspace -- -D warnings -W clippy::pedantic | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-hack | |
| - name: check | |
| run: cargo hack check --feature-powerset --at-least-one-of std,no_std --mutually-exclusive-features std,no_std --group-features std,default --no-dev-deps --verbose | |
| build-std: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: build | |
| run: cargo build --features serde,evm,starknet --verbose | |
| build-no-std: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Add no_std target | |
| run: rustup target add thumbv7em-none-eabihf | |
| - name: build | |
| run: cargo build --target thumbv7em-none-eabihf --no-default-features --features no_std,serde,evm,starknet --verbose | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: std | |
| args: "" | |
| - name: no-std | |
| args: "--no-default-features --features no_std" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: test | |
| run: cargo test --features evm,starknet,serde ${{ matrix.args }} --verbose | |
| minimal-versions: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - name: Resolve minimal versions | |
| run: cargo -Z minimal-versions update --workspace | |
| - name: build | |
| run: cargo build --features serde,evm,starknet --verbose | |
| - name: test | |
| run: cargo test --features serde,evm,starknet --verbose |