ci.yml 1.2 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. 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@v2
  23. - uses: actions/cache@v2
  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: actions-rs/toolchain@v1
  34. with:
  35. toolchain: nightly
  36. target: thumbv7m-none-eabi
  37. default: true
  38. components: rustfmt, clippy
  39. - run: cargo install cargo-readme
  40. - run: cargo test
  41. - name: cargo build no_std
  42. run: cargo build --target thumbv7m-none-eabi --no-default-features
  43. - name: cargo clippy
  44. uses: actions-rs/clippy-check@v1
  45. with:
  46. token: ${{ secrets.GITHUB_TOKEN }}
  47. args: --all-features
  48. - name: Ensure README.md is updated
  49. run: '[ "$(< README.md)" = "$(cargo readme)" ]'