|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Python application |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ master ] |
| 9 | + pull_request: |
| 10 | + branches: [ master ] |
| 11 | + |
| 12 | +jobs: |
| 13 | + tests_python: |
| 14 | + name: Test on Python ${{ matrix.python_version }} and Django ${{ matrix.django_version }} |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + django_version: [ '1.11', '2.0', '2.1', '2.2', '3.0', '3.1' ] |
| 19 | + python_version: [ '3.4', '3.5', '3.6', '3.7', '3.8', '3.9' ] |
| 20 | + exclude: |
| 21 | + - django_version: '1.11' |
| 22 | + python_version: '3.8' |
| 23 | + - django_version: '1.11' |
| 24 | + python_version: '3.9' |
| 25 | + |
| 26 | + - django_version: '2.0' |
| 27 | + python_version: '3.8' |
| 28 | + - django_version: '2.0' |
| 29 | + python_version: '3.9' |
| 30 | + |
| 31 | + - django_version: '2.1' |
| 32 | + python_version: '3.4' |
| 33 | + - django_version: '2.1' |
| 34 | + python_version: '3.8' |
| 35 | + - django_version: '2.1' |
| 36 | + python_version: '3.9' |
| 37 | + |
| 38 | + - django_version: '2.2' |
| 39 | + python_version: '3.4' |
| 40 | + |
| 41 | + - django_version: '3.0' |
| 42 | + python_version: '3.4' |
| 43 | + - django_version: '3.0' |
| 44 | + python_version: '3.5' |
| 45 | + |
| 46 | + - django_version: '3.1' |
| 47 | + python_version: '3.4' |
| 48 | + - django_version: '3.1' |
| 49 | + python_version: '3.5' |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 53 | + |
| 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: ${{ matrix.python_version }} |
| 60 | + - name: Cache pip |
| 61 | + uses: actions/cache@v2 |
| 62 | + with: |
| 63 | + # This path is specific to Ubuntu |
| 64 | + path: ~/.cache/pip |
| 65 | + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.django_version }} |
| 66 | + - name: Install dependencies |
| 67 | + run: | |
| 68 | + python -m pip install --upgrade pip |
| 69 | + pip install -U flake8 coveralls argparse |
| 70 | + pip install -U Django~=${{ matrix.django_version }} |
| 71 | + - name: Lint with flake8 |
| 72 | + run: | |
| 73 | + flake8 --ignore=E501,W504 safedelete |
| 74 | + - name: Test Django |
| 75 | + if: matrix.django_version != '1.11' |
| 76 | + run: | |
| 77 | + python -m coverage run `which django-admin.py` test --settings=safedelete.tests.settings |
| 78 | + - name: Coverage |
| 79 | + if: ${{ success() }} |
| 80 | + run: | |
| 81 | + coveralls |
0 commit comments