fuzeman/trakt.py

View on GitHub
.github/workflows/test.yml

Summary

Maintainability
Test Coverage
name: Test Runner

# Controls when the workflow will run
on:
  # Triggers the workflow on push to any branch or pull request events only on the "develop" branch
  push:
    branches: [ "*" ]
  pull_request:
    branches: [ "develop" ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "test"
  test:
    name: Python ${{ matrix.python-version }} on ${{ matrix.os }} Test
    # The type of runner that the job will run on
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy3.9]

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install tox tox-gh-actions
      - name: Run tests with tox
        run: |
          tox --skip-missing-interpreters false
  lint:
    needs: test
    name: Linting and coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: "3.10"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install tox
      - name: lint and get coverage with tox
        run: |
          tox -e flake8
          tox -e stats
      - name: Report to coveralls
        uses: coverallsapp/github-action@v2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: ./coverage.lcov