name: CI
on:
push:
branches: [main]
pull_request:
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: Check formatting
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy (all targets, all features)
run: cargo clippy --all-targets --all-features -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build (default features)
run: cargo build
- name: Test (default features + test)
run: cargo test --features test
no_std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: no_std+alloc build (ocpp_1_6)
run: cargo build -p ocpp-client --lib --no-default-features --features ocpp_1_6
- name: no_std+alloc build (ocpp_2_0_1)
run: cargo build -p ocpp-client --lib --no-default-features --features ocpp_2_0_1
- name: no_std+alloc build (ocpp_2_1)
run: cargo build -p ocpp-client --lib --no-default-features --features ocpp_2_1
embedded:
runs-on: ubuntu-latest
env:
RUSTFLAGS: --cfg getrandom_backend="custom"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
components: clippy
- uses: Swatinem/rust-cache@v2
- name: ocpp-transport-embassy-net check (thumbv7em-none-eabihf)
run: cargo check -p ocpp-transport-embassy-net --target thumbv7em-none-eabihf
- name: ocpp-transport-embassy-net clippy (thumbv7em-none-eabihf)
run: cargo clippy -p ocpp-transport-embassy-net --target thumbv7em-none-eabihf -- -D warnings
- name: ocpp-board-stm32h723-nucleo build (thumbv7em-none-eabihf, full link)
run: cargo build -p ocpp-board-stm32h723-nucleo --target thumbv7em-none-eabihf
- name: ocpp-board-stm32h723-nucleo clippy (thumbv7em-none-eabihf)
run: cargo clippy -p ocpp-board-stm32h723-nucleo --target thumbv7em-none-eabihf -- -D warnings