diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..8f654c6 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,20 @@ +name: Check Rust + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install nightly + run: rustup toolchain add --component=rustfmt nightly + - name: Checks + run: ./ci.sh diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..eec3c67 --- /dev/null +++ b/ci.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +export RUSTFLAGS=-Dwarnings + +cargo +nightly fmt -- --check + +cargo clippy +cargo clippy --features embassy-time + +cargo clippy --features defmt +cargo clippy --features defmt,embassy-time + +cargo clippy --features log +cargo clippy --features log,embassy-time + +cargo test --features embassy-time