ci.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. RUSTDOCFLAGS: -Dwarnings
  14. RUST_BACKTRACE: 1
  15. defaults:
  16. run:
  17. shell: bash
  18. jobs:
  19. test:
  20. name: cargo +nightly build
  21. runs-on: ubuntu-latest
  22. steps:
  23. - uses: actions/checkout@v4
  24. - name: Install latest nightly
  25. uses: dtolnay/rust-toolchain@nightly
  26. with:
  27. toolchain: nightly
  28. targets: thumbv7m-none-eabi
  29. components: rustfmt, clippy
  30. - uses: Swatinem/rust-cache@v2
  31. - run: cargo fmt --check
  32. - run: cargo test
  33. - run: cargo clippy --all-features
  34. - run: cargo doc --all-features
  35. # Ensure that the library doesn't depend on std/alloc. A binary
  36. # that depends on the library is used for this (instead of
  37. # directly build the library), otherwise accidentally depending on
  38. # `alloc` would not result in an error.
  39. - name: cargo build no_std
  40. run: cargo build --target thumbv7m-none-eabi --no-default-features
  41. working-directory: ci/ensure_no_std
  42. - run: cargo install cargo-readme
  43. - name: Ensure README.md is up-to-date
  44. run: '[ "$(< README.md)" = "$(cargo readme)" ]'