run-tests.yml 2.6 KB

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