ci.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: CI
  2. on:
  3. pull_request:
  4. branches:
  5. - master
  6. push:
  7. branches:
  8. - master
  9. schedule:
  10. - cron: '0 1 * * *'
  11. env:
  12. RUSTFLAGS: -D warnings
  13. RUST_BACKTRACE: 1
  14. defaults:
  15. run:
  16. shell: bash
  17. jobs:
  18. test:
  19. name: cargo +nightly build
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v4
  23. - uses: actions/cache@v4
  24. with:
  25. path: |
  26. ~/.cargo/bin
  27. ~/.cargo/registry
  28. ~/.cargo/git
  29. ~/.cargo/.crates.toml
  30. target
  31. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  32. - name: Install latest nightly
  33. uses: dtolnay/rust-toolchain@nightly
  34. with:
  35. toolchain: nightly
  36. targets: thumbv7m-none-eabi
  37. components: rustfmt, clippy
  38. - run: cargo install cargo-readme
  39. - run: cargo fmt --check
  40. - run: cargo test
  41. - name: cargo build no_std
  42. run: cargo build --target thumbv7m-none-eabi --no-default-features
  43. - run: cargo clippy --all-features
  44. - name: Ensure README.md is updated
  45. run: '[ "$(< README.md)" = "$(cargo readme)" ]'