sahitono/geosardine

View on GitHub
.github/workflows/python-package.yml

Summary

Maintainability
Test Coverage
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: python package

on:
  push:
    branches: [ master, github-actions ]
  pull_request:
    branches: [ master, github-actions ]

jobs:
  build:

    strategy:
      matrix:
        python-version: [3.7, 3.8]
        os: [ubuntu-20.04]
        
    runs-on: ${{ matrix.os }}
    
    steps:
    - uses: actions/checkout@v2
      
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install library
      run: |
        sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
        sudo apt update
        sudo apt install gdal-bin libgdal-dev
        
    - name: Install Poetry
      uses: snok/install-poetry@v1.1.1
      with:
        virtualenvs-in-project: false
        virtualenvs-path: ~/my-custom-path
      
    - name: Install dependencies
      run: |
        poetry run pip install --upgrade pip
        poetry install
      
    - name: Code quality
      run: poetry run black . --check
      
    - name: Test with pytest
      run: poetry run pytest --cov=./ --cov-report xml
      
    - name: Code coverage
      uses: codecov/codecov-action@v1
      with:
        token: 025e20a3-f046-4a80-a954-7c6cdb1676af