run-tests.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. name: Tests
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. jobs:
  7. run_tests:
  8. runs-on: ubuntu-latest
  9. strategy:
  10. matrix:
  11. python-version: [ 3.7, 3.8, 3.9 ]
  12. timeout-minutes: 15
  13. steps:
  14. - uses: actions/checkout@v2
  15. - name: Set up Python
  16. uses: actions/setup-python@v2
  17. with:
  18. python-version: ${{ matrix.python-version }}
  19. - name: Cache dependencies
  20. uses: actions/cache@v2
  21. with:
  22. path: ~/.cache/pip
  23. key: Key-v1-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
  24. - name: Install dependencies
  25. run: |
  26. python -m pip install --upgrade pip
  27. pip install -r requirements.txt
  28. pip install -r requirements-dev.txt
  29. - name: Build bitsandbytes
  30. run: |
  31. pip install bitsandbytes==0.32.3
  32. - name: Build hivemind
  33. run: |
  34. pip install .
  35. - name: Test
  36. run: |
  37. cd tests
  38. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  39. pytest --durations=0 --durations-min=1.0 -v
  40. build_and_test_p2pd:
  41. runs-on: ubuntu-latest
  42. timeout-minutes: 10
  43. steps:
  44. - uses: actions/checkout@v2
  45. - uses: actions/setup-go@v3
  46. with:
  47. go-version: '1.16'
  48. check-latest: true
  49. - name: Set up Python
  50. uses: actions/setup-python@v2
  51. with:
  52. python-version: '3.8'
  53. - name: Cache dependencies
  54. uses: actions/cache@v2
  55. with:
  56. path: ~/.cache/pip
  57. key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
  58. - name: Install dependencies
  59. run: |
  60. python -m pip install --upgrade pip
  61. pip install -r requirements.txt
  62. pip install -r requirements-dev.txt
  63. - name: Build hivemind
  64. run: |
  65. pip install . --global-option=build_py --global-option="--buildgo" --no-use-pep517
  66. - name: Test
  67. run: |
  68. cd tests
  69. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  70. pytest -k "p2p" -v
  71. codecov_in_develop_mode:
  72. runs-on: ubuntu-latest
  73. timeout-minutes: 15
  74. steps:
  75. - uses: actions/checkout@v2
  76. - name: Set up Python
  77. uses: actions/setup-python@v2
  78. with:
  79. python-version: '3.8'
  80. - name: Cache dependencies
  81. uses: actions/cache@v2
  82. with:
  83. path: ~/.cache/pip
  84. key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
  85. - name: Install dependencies
  86. run: |
  87. python -m pip install --upgrade pip
  88. pip install -r requirements.txt
  89. pip install -r requirements-dev.txt
  90. - name: Build bitsandbytes
  91. run: |
  92. pip install bitsandbytes==0.32.3
  93. - name: Build hivemind
  94. run: |
  95. pip install -e . --no-use-pep517
  96. - name: Test
  97. run: |
  98. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  99. pytest --cov hivemind -v tests
  100. - name: Upload coverage to Codecov
  101. uses: codecov/codecov-action@v1