ci.yml 1.2 KB

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