You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.yml 2.8KB

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