run-tests.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 --cov=hivemind
  33. - name: Upload to codecov
  34. run: |
  35. codecov
  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-${{ matrix.python-version }}-${{ 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"
  58. - name: Test
  59. run: |
  60. cd tests
  61. pytest -k "p2p"