loom.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. on:
  2. push:
  3. branches:
  4. - main
  5. paths:
  6. - '**.rs'
  7. - '**/Cargo.toml'
  8. - '.github/workflows/loom.yml'
  9. workflow_dispatch:
  10. pull_request:
  11. paths:
  12. - '**.rs'
  13. - '**/Cargo.toml'
  14. - '.github/workflows/loom.yml'
  15. name: Loom Models
  16. env:
  17. LOOM_LOG: loom=debug
  18. jobs:
  19. # Run particularly slow loom models individually
  20. slow_models:
  21. strategy:
  22. matrix:
  23. model:
  24. - mpsc_send_recv_wrap
  25. - mpsc_try_send_recv
  26. - mpsc::rx_close_unconsumed
  27. - mpsc_sync::rx_close_unconsumed
  28. name: model '${{ matrix.model }}''
  29. runs-on: ubuntu-latest
  30. steps:
  31. - uses: actions/checkout@v2
  32. - name: Install stable toolchain
  33. uses: actions-rs/toolchain@v1
  34. with:
  35. profile: minimal
  36. toolchain: stable
  37. override: true
  38. - name: Run model
  39. run: cargo test --profile loom --lib -- ${{ matrix.model }}
  40. env:
  41. # it would be nice to run these with more preemptions, but
  42. # that makes these models super slow...and LOOM_MAX_PREEMPTIONS=1 is
  43. # good enough for Tokio's CI, so...
  44. LOOM_MAX_PREEMPTIONS: 1
  45. RUSTFLAGS: "--cfg loom"
  46. # Run other loom models by scope
  47. models:
  48. strategy:
  49. matrix:
  50. scope:
  51. # NOTE: if adding loom models in a new module, that module needs to be
  52. # added to this list!
  53. - mpsc_sync
  54. - mpsc_async
  55. - thingbuf
  56. - util
  57. name: models in '${{ matrix.scope }}'
  58. runs-on: ubuntu-latest
  59. steps:
  60. - uses: actions/checkout@v2
  61. - name: Install stable toolchain
  62. uses: actions-rs/toolchain@v1
  63. with:
  64. profile: minimal
  65. toolchain: stable
  66. override: true
  67. - name: Run models
  68. run: cargo test --profile loom --lib -- ${{ matrix.scope }}
  69. env:
  70. LOOM_MAX_PREEMPTIONS: 2
  71. # `--cfg ci_skip_slow_models` will exclude the loom models that are
  72. # tested in `slow-models`.
  73. RUSTFLAGS: "--cfg loom --cfg ci_skip_slow_models"
  74. # Dummy job that requires all loom models to pass
  75. all_models:
  76. name: all loom models
  77. runs-on: ubuntu-latest
  78. needs:
  79. - slow_models
  80. - models
  81. steps:
  82. - run: exit 0