nephila/python-taiga

View on GitHub
.github/workflows/lint.yml

Summary

Maintainability
Test Coverage
name: Code quality

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    strategy:
      matrix:
        python-version: [3.8]
        toxenv: [pep8, isort, black, pypi-description, docs, towncrier]
    steps:
    - uses: actions/checkout@v2
      with:
        repository: ${{ github.event.pull_request.head.repo.full_name }}
        ref: ${{ github.event.pull_request.head.ref }}
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Cache pip
      uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
        restore-keys: |
          ${{ runner.os }}-pip-${{ matrix.toxenv }}
    - name: Cache tox
      uses: actions/cache@v1
      with:
        path: .tox
        key: ${{ runner.os }}-lint-${{ matrix.toxenv }}-${{ hashFiles('setup.cfg') }}
        restore-keys: |
          ${{ runner.os }}-lint-${{ matrix.toxenv }}-
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip setuptools tox>=1.8
    - name: Test with tox
      run: |
        tox -e${{ matrix.toxenv }}