|  | 
|  | 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: [ '2.2', '3.0', '3.1', '3.2' ] | 
|  | 19 | +        python_version: [ '3.5', '3.6', '3.7', '3.8', '3.9' ] | 
|  | 20 | +        exclude: | 
|  | 21 | +          - django_version: '3.0' | 
|  | 22 | +            python_version: '3.5' | 
|  | 23 | + | 
|  | 24 | +          - django_version: '3.1' | 
|  | 25 | +            python_version: '3.5' | 
|  | 26 | + | 
|  | 27 | +          - django_version: '3.2' | 
|  | 28 | +            python_version: '3.5' | 
|  | 29 | +    env: | 
|  | 30 | +      SPATIALITE_LIBRARY_PATH: 'mod_spatialite.so' | 
|  | 31 | +      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
|  | 32 | +      COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | 
|  | 33 | + | 
|  | 34 | +    steps: | 
|  | 35 | +    - uses: actions/checkout@v2 | 
|  | 36 | +    - name: Set up Python ${{ matrix.python_version }} | 
|  | 37 | +      uses: actions/setup-python@v2 | 
|  | 38 | +      with: | 
|  | 39 | +        python-version: ${{ matrix.python_version }} | 
|  | 40 | +    - name: Cache pip | 
|  | 41 | +      uses: actions/cache@v2 | 
|  | 42 | +      with: | 
|  | 43 | +        # This path is specific to Ubuntu | 
|  | 44 | +        path: ~/.cache/pip | 
|  | 45 | +        key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.django_version }} | 
|  | 46 | +    - name: Install dependencies | 
|  | 47 | +      run: | | 
|  | 48 | +        sudo apt-get update -qq | 
|  | 49 | +        sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev libsqlite3-mod-spatialite | 
|  | 50 | +        python -m pip install --upgrade pip | 
|  | 51 | +        pip install -U flake8 coveralls argparse jsonfield | 
|  | 52 | +        pip install -U Django~=${{ matrix.django_version }}.0 | 
|  | 53 | +    - name: Lint with flake8 | 
|  | 54 | +      run: | | 
|  | 55 | +        flake8 --ignore=E501,W504 djgeojson | 
|  | 56 | +    - name: Test | 
|  | 57 | +      run: | | 
|  | 58 | +        python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run ./quicktest.py djgeojson | 
|  | 59 | +    - name: Coverage | 
|  | 60 | +      if: ${{ success() }} | 
|  | 61 | +      run: | | 
|  | 62 | +        coveralls | 
0 commit comments