name: CI

on:
  push:
    branches: [ master ]
    tags: [ '*' ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install -U pip
        python -m pip install setuptools_scm wheel

    - name: Build
      run: |
        python setup.py sdist bdist_wheel

    - name: Upload dist
      uses: actions/upload-artifact@v2-preview
      with:
        name: desmod-dist
        path: "dist/*"

  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, pypy3]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install -U pip
        python -m pip install -e . -r requirements.txt

    - name: Test
      run: |
        make test

  lint:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install -U pip
        python -m pip install -e . -r requirements.txt black
    - name: Lint
      run: |
        make lint

  coverage:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install -U pip
        python -m pip install -e . -r requirements.txt coveralls
    - name: Coverage
      env:
        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
      run: |
        make coverage && coveralls

Add GitHub Action for CI
Add GitHub Action for CI

This CI action performs build, test, lint, and coverage jobs.
