run-tests.yml 2.7 KB

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