run-tests.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 hivemind
  30. run: |
  31. pip install .
  32. - name: Test
  33. run: |
  34. cd tests
  35. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  36. pytest --durations=0 --durations-min=1.0 -v
  37. build_and_test_p2pd:
  38. runs-on: ubuntu-latest
  39. timeout-minutes: 10
  40. steps:
  41. - uses: actions/checkout@v2
  42. - uses: actions/setup-go@v3
  43. with:
  44. go-version: '1.16'
  45. check-latest: true
  46. - name: Set up Python
  47. uses: actions/setup-python@v2
  48. with:
  49. python-version: '3.8'
  50. - name: Cache dependencies
  51. uses: actions/cache@v2
  52. with:
  53. path: ~/.cache/pip
  54. key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
  55. - name: Install dependencies
  56. run: |
  57. python -m pip install --upgrade pip
  58. pip install -r requirements.txt
  59. pip install -r requirements-dev.txt
  60. - name: Build hivemind
  61. run: |
  62. pip install . --global-option=build_py --global-option="--buildgo" --no-use-pep517
  63. - name: Test
  64. run: |
  65. cd tests
  66. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  67. pytest -k "p2p" -v
  68. codecov_in_develop_mode:
  69. runs-on: ubuntu-latest
  70. timeout-minutes: 15
  71. steps:
  72. - uses: actions/checkout@v2
  73. - name: Set up Python
  74. uses: actions/setup-python@v2
  75. with:
  76. python-version: '3.8'
  77. - name: Cache dependencies
  78. uses: actions/cache@v2
  79. with:
  80. path: ~/.cache/pip
  81. key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
  82. - name: Install dependencies
  83. run: |
  84. python -m pip install --upgrade pip
  85. pip install -r requirements.txt
  86. pip install -r requirements-dev.txt
  87. - name: Build hivemind
  88. run: |
  89. pip install -e . --no-use-pep517
  90. - name: Test
  91. run: |
  92. export HIVEMIND_MEMORY_SHARING_STRATEGY=file_descriptor
  93. pytest --cov hivemind -v tests
  94. - name: Upload coverage to Codecov
  95. uses: codecov/codecov-action@v1