run-tests.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. echo 123
  33. for i in {1...50}; do LOGLEVEL=DEBUG python -c "from test_averaging import test_allreduce_once_edge_cases, test_allgather; print(test_allreduce_once_edge_cases(1, 3), test_allreduce_once_edge_cases(0, 3), test_allgather(), 'SUCCESS'*50)"; done;
  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