name: Build/test on Linux
# This workflow is triggered on pushes to the repository.
on: [push, pull_request]

jobs:
    test:
        runs-on: ubuntu-latest
        strategy:
            matrix:
                tox: [
                    {'py': '3.6', 'env': 'py36'},
                    {'py': '3.7', 'env': 'py37'},
                    {'py': '3.8', 'env': 'py38'},
                ]
        name: "Python: ${{ matrix.tox.py }}"
        steps:
            - uses: actions/checkout@master
            - name: Setup python
              uses: actions/setup-python@v1
              with:
                  python-version: ${{ matrix.tox.py }}
                  architecture: x64
            - run: pip install tox
            - name: Running tox
              run: tox -e ${{ matrix.tox.env }}
    lint:
        runs-on: ubuntu-latest
        name: Validates the package
        steps:
            - uses: actions/checkout@master
            - name: Setup python
              uses: actions/setup-python@v1
              with:
                  python-version: 3.8
                  architecture: x64
            - run: pip install tox
            - run: tox -e lint
    docs:
        runs-on: ubuntu-latest
        name: Build the documentation
        steps:
            - uses: actions/checkout@master
            - name: Setup python
              uses: actions/setup-python@v1
              with:
                  python-version: 3.8
                  architecture: x64
            - run: pip install tox
            - run: tox -e docs
