Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. name: Tests
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. jobs:
  10. test:
  11. name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: true
  15. matrix:
  16. python-version: [3.7, 3.8, 3.9]
  17. django-version: [3.1, 3.2]
  18. services:
  19. postgres:
  20. image: postgres:10
  21. ports:
  22. - 5432/tcp
  23. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  24. env:
  25. POSTGRES_USER: postgres
  26. POSTGRES_PASSWORD: postgres
  27. POSTGRES_DB: postgres
  28. steps:
  29. - uses: actions/checkout@v2
  30. - name: Set up Python ${{ matrix.python-version }}
  31. uses: actions/setup-python@v2
  32. with:
  33. python-version: ${{ matrix.python-version }}
  34. - name: Install dependencies
  35. run: |
  36. python -m pip install --upgrade pip
  37. pip install pytest
  38. pip install -e .[test]
  39. pip install -r requirements.txt
  40. pip install "django~=${{ matrix.django-version }}.0"
  41. - name: Run tests
  42. env:
  43. DATABASE_USER: postgres
  44. DATABASE_PASSWORD: postgres
  45. DATABASE_HOST: localhost
  46. DATABASE_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
  47. run: |
  48. coverage run --parallel -m pytest -x
  49. - name: Upload coverage to Codecov
  50. uses: codecov/codecov-action@v1
  51. with:
  52. fail_ci_if_error: true
  53. lint_python:
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: Set up Python ${{ matrix.python-version }}
  58. uses: actions/setup-python@v2
  59. with:
  60. python-version: 3.8
  61. - name: Install dependencies
  62. run: |
  63. python -m pip install --upgrade pip
  64. pip install -r requirements.txt
  65. - name: Run linters
  66. run: |
  67. flake8 src tests setup.py
  68. isort -c -q --diff src/ tests/
  69. lint_js:
  70. runs-on: ubuntu-latest
  71. steps:
  72. - uses: actions/checkout@v2
  73. - name: Set up NodeJS
  74. uses: actions/setup-node@v1
  75. - name: Install dependencies
  76. run: |
  77. npm ci
  78. - name: Run linters
  79. run: |
  80. npm run eslint
  81. sandbox:
  82. runs-on: ubuntu-latest
  83. steps:
  84. - uses: actions/checkout@v2
  85. - name: Set up Python ${{ matrix.python-version }}
  86. uses: actions/setup-python@v2
  87. with:
  88. python-version: 3.8
  89. - name: Build sandbox
  90. run: |
  91. python -m pip install --upgrade pip
  92. make sandbox
  93. docs:
  94. runs-on: ubuntu-latest
  95. steps:
  96. - uses: actions/checkout@v2
  97. - name: Set up Python ${{ matrix.python-version }}
  98. uses: actions/setup-python@v2
  99. with:
  100. python-version: 3.8
  101. - name: Build docs
  102. run: |
  103. make docs