run-tests.yml 2.8 KB

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