run-tests.yml 2.6 KB

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