tests.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. on:
  2. push:
  3. branches:
  4. - main
  5. paths:
  6. - '**.rs'
  7. - '**/Cargo.toml'
  8. - '.github/workflows/tests.yml'
  9. workflow_dispatch:
  10. pull_request:
  11. paths:
  12. - '**.rs'
  13. - '**/Cargo.toml'
  14. - '.github/workflows/tests.yml'
  15. env:
  16. RUSTFLAGS: -Dwarnings
  17. RUST_BACKTRACE: 1
  18. msrv: 1.57.0
  19. name: Tests
  20. jobs:
  21. tests:
  22. name: Tests
  23. runs-on: ubuntu-latest
  24. strategy:
  25. matrix:
  26. rust:
  27. - stable
  28. - nightly
  29. - 1.57.0
  30. steps:
  31. - uses: actions/checkout@v2
  32. - name: Install toolchain
  33. uses: actions-rs/toolchain@v1
  34. with:
  35. profile: minimal
  36. toolchain: ${{ matrix.rust }}
  37. override: true
  38. components: rustfmt
  39. - name: Run cargo test (with static APIs)
  40. if: ${{ matrix.rust != env.msrv }}
  41. uses: actions-rs/cargo@v1
  42. with:
  43. command: test
  44. args: --features static
  45. - name: Run cargo test (no static APIs)
  46. if: ${{ matrix.rust == env.msrv }}
  47. uses: actions-rs/cargo@v1
  48. with:
  49. command: test
  50. benches:
  51. name: Compile benchmarks
  52. runs-on: ubuntu-latest
  53. steps:
  54. - uses: actions/checkout@v2
  55. - name: Install stable toolchain
  56. uses: actions-rs/toolchain@v1
  57. with:
  58. profile: minimal
  59. toolchain: stable
  60. override: true
  61. components: rustfmt
  62. - name: Run cargo check
  63. uses: actions-rs/cargo@v1
  64. with:
  65. command: check
  66. args: -p bench --benches