Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

test.yml 2.7KB

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