rust.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: Build
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. env:
  8. CARGO_TERM_COLOR: always
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. rust:
  15. - stable
  16. - nightly
  17. - 1.52.1 # MSVR
  18. steps:
  19. - uses: actions/checkout@v2
  20. # Important preparation step: override the latest default Rust version in GitHub CI
  21. # with the current value of the iteration in the "strategy.matrix.rust"-array.
  22. - uses: actions-rs/toolchain@v1
  23. with:
  24. profile: default
  25. toolchain: ${{ matrix.rust }}
  26. override: true
  27. # helps to identify if the right cargo version is actually used
  28. - run: cargo version
  29. - name: Build
  30. run: cargo build --verbose
  31. - name: Run tests
  32. run: cargo test --verbose
  33. build_no_std:
  34. runs-on: ubuntu-latest
  35. strategy:
  36. matrix:
  37. rust:
  38. - stable
  39. - nightly
  40. - 1.52.1 # MSVR
  41. steps:
  42. - uses: actions/checkout@v2
  43. # Important preparation step: override the latest default Rust version in GitHub CI
  44. # with the current value of the iteration in the "strategy.matrix.rust"-array.
  45. - uses: actions-rs/toolchain@v1
  46. with:
  47. profile: default
  48. toolchain: ${{ matrix.rust }}
  49. override: true
  50. # helps to identify if the right cargo version is actually used
  51. - run: cargo version
  52. - name: "Rustup: install some no_std target"
  53. run: rustup target add thumbv7em-none-eabihf
  54. - name: Build (no_std)
  55. run: cargo build --target thumbv7em-none-eabihf
  56. # As discussed, these tasks are optional for PRs.
  57. style_checks:
  58. runs-on: ubuntu-latest
  59. strategy:
  60. matrix:
  61. rust:
  62. - stable
  63. steps:
  64. - uses: actions/checkout@v2
  65. # Important preparation step: override the latest default Rust version in GitHub CI
  66. # with the current value of the iteration in the "strategy.matrix.rust"-array.
  67. - uses: actions-rs/toolchain@v1
  68. with:
  69. profile: default
  70. toolchain: ${{ matrix.rust }}
  71. override: true
  72. # helps to identify if the right cargo version is actually used
  73. - run: cargo version
  74. - name: Rustfmt
  75. run: cargo fmt -- --check
  76. - name: Clippy
  77. run: cargo clippy
  78. - name: Rustdoc
  79. run: cargo doc