This is a reusable workflow to ensure quality Python code. For general help with reusable workflows, read GitHub's Reusing workflows documentation.
To use this workflow, just set it in the uses key of a job in your project's workflow file.
Here is an example workflow snippet that calls this workflow:
jobs:
dotFiles:
name: Python
uses: brobeson/PythonWorkflow/.github/workflows/python.yaml@v1The workflow has two jobs: Static Analysis and Test.
The Static Analysis job runs the steps described in the following sections.
- Format Check The job runs Black on all Python files in the repository. Use a configuration file in your repository to control how Black formats your code. The job reports mis-formatted files; it does not modify any files.
- PyLint
The job runs PyLint on all Python files in the repository. Use a configuration file in your repository to control PyLint runs. - MyPy
The job runs MyPy on all Python files in the repository. Use a configuration file in your repository to control MyPy runs. - isort
The job runs isort on all Python files in the repository. Use a configuration file in your repository to control isort runs. - Build Docs
The job runs Sphinx in the docs/ directory to ensure documentation builds without issues.
The Test job runs tests on multiple platforms, with multiple versions of Python.
- Run Tests
The job runs pytest. This step assumes your tests follow default pytest conventions, or you configured pytest in your repository. - Report Test Coverage
After running tests, the job uploads coverage data to Coveralls. It uploads a separate report for each cell in the test matrix (OS / Python combination).