run-tests.yml 3.0 KB

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