rust.yml 794 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. - name: Build
  21. run: cargo build --verbose
  22. - name: Run tests
  23. run: cargo test --verbose
  24. # As discussed, these tasks are optional for PRs.
  25. style_checks:
  26. runs-on: ubuntu-latest
  27. strategy:
  28. matrix:
  29. rust:
  30. - stable
  31. steps:
  32. - uses: actions/checkout@v2
  33. - name: Rustfmt
  34. run: cargo fmt -- --check
  35. - name: Clippy
  36. run: cargo clippy
  37. - name: Rustdoc
  38. run: cargo doc