Structural Refactor #230
Workflow file for this run
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: Unit Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- README.md | |
push: | |
branches: [master] | |
paths-ignore: | |
- README.md | |
permissions: | |
contents: read | |
env: | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.88.0 | |
components: clippy | |
- uses: mozilla-actions/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all --all-features -- -D warnings | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- uses: mozilla-actions/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo doc --all-features --no-deps | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
no_std: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- rust: 1.88.0 | |
target: armv7a-none-eabi | |
- rust: stable | |
target: armv7a-none-eabi | |
- rust: 1.88.0 | |
target: thumbv7em-none-eabi | |
- rust: stable | |
target: thumbv7em-none-eabi | |
- rust: 1.88.0 | |
target: wasm32-unknown-unknown | |
- rust: stable | |
target: wasm32-unknown-unknown | |
- rust: 1.88.0 | |
target: riscv32imac-unknown-none-elf | |
- rust: stable | |
target: riscv32imac-unknown-none-elf | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
targets: ${{ matrix.target }} | |
- uses: mozilla-actions/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.target }} | |
- run: cargo build --no-default-features --features tls12,full,alloc --release --target ${{ matrix.target }} | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
RUSTFLAGS: --cfg getrandom_backend="custom" | |
test: | |
strategy: | |
matrix: | |
toolchain: | |
- 1.88.0 # MSRV | |
- stable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- uses: mozilla-actions/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.toolchain }} | |
- run: cargo test --features tls12 | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
- name: Test no_std with alloc | |
run: cargo test --no-default-features --features tls12,full,alloc | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
cross: | |
strategy: | |
matrix: | |
include: | |
- target: powerpc-unknown-linux-gnu | |
rust: 1.88.0 # MSRV | |
- target: powerpc-unknown-linux-gnu | |
rust: stable | |
- target: aarch64-unknown-linux-gnu | |
rust: 1.88.0 | |
- target: aarch64-unknown-linux-gnu | |
rust: stable | |
- target: armv7-unknown-linux-gnueabihf | |
rust: 1.88.0 | |
- target: armv7-unknown-linux-gnueabihf | |
rust: stable | |
- target: riscv64gc-unknown-linux-gnu | |
rust: 1.88.0 | |
- target: riscv64gc-unknown-linux-gnu | |
rust: stable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cross-compile library | |
uses: houseabsolute/actions-rust-cross@v1 | |
with: | |
command: build | |
target: ${{ matrix.target }} | |
toolchain: ${{ matrix.rust }} | |
args: "--release --all-features" | |
- name: Cross-test library | |
uses: houseabsolute/actions-rust-cross@v1 | |
with: | |
command: test | |
target: ${{ matrix.target }} | |
toolchain: ${{ matrix.rust }} | |
args: "--release --all-features" |