|
| 1 | +name: Tests |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + test: |
| 6 | + name: Run test |
| 7 | + runs-on: ubuntu-latest |
| 8 | + continue-on-error: ${{ matrix.django-rest-framework == 'master' }} |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + python-version: ["3.6", "3.7", "3.8", "3.9"] |
| 13 | + django: ["2.2", "3.0", "3.1"] |
| 14 | + django-rest-framework: ["3.12", "master"] |
| 15 | + env: |
| 16 | + PYTHON: ${{ matrix.python-version }} |
| 17 | + DJANGO: ${{ matrix.django }} |
| 18 | + DJANGO_REST_FRAMEWORK: ${{ matrix.django-rest-framework }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v2 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install tox tox-gh-actions |
| 29 | + - name: Test with tox |
| 30 | + run: tox |
| 31 | + - name: Upload coverage report |
| 32 | + uses: codecov/codecov-action@v1 |
| 33 | + with: |
| 34 | + env_vars: PYTHON,DJANGO,DJANGO_REST_FRAMEWORK |
| 35 | + check: |
| 36 | + name: Run check |
| 37 | + runs-on: ubuntu-latest |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + tox-env: ["black", "lint", "docs"] |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v2 |
| 44 | + - name: Set up Python 3.6 |
| 45 | + uses: actions/setup-python@v2 |
| 46 | + with: |
| 47 | + python-version: 3.6 |
| 48 | + - name: Install dependencies |
| 49 | + run: | |
| 50 | + python -m pip install --upgrade pip |
| 51 | + pip install tox |
| 52 | + - name: Run lint |
| 53 | + run: tox |
| 54 | + env: |
| 55 | + TOXENV: ${{ matrix.tox-env }} |
0 commit comments