run-tests.yml 2.7 KB

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