tests.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: --all-features
  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. # skip doctests, which require all features to be enabled
  51. args: --lib --tests
  52. benches:
  53. name: Compile benchmarks
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: Install stable toolchain
  58. uses: actions-rs/toolchain@v1
  59. with:
  60. profile: minimal
  61. toolchain: stable
  62. override: true
  63. components: rustfmt
  64. - name: Run cargo check
  65. uses: actions-rs/cargo@v1
  66. with:
  67. command: check
  68. args: -p bench --benches