|
13 | 13 | # Allows you to run this workflow manually from the Actions tab
|
14 | 14 | workflow_dispatch:
|
15 | 15 |
|
16 |
| -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
17 | 16 | jobs:
|
18 |
| - # This workflow contains a single job called "build" |
19 |
| - build: |
20 |
| - # The type of runner that the job will run on |
| 17 | + test_and_flake8: |
| 18 | + name: Tests + flake8 |
21 | 19 | runs-on: ubuntu-latest
|
22 |
| - |
23 |
| - # Steps represent a sequence of tasks that will be executed as part of the job |
24 | 20 | steps:
|
25 |
| - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
26 | 21 | - uses: actions/checkout@v2
|
27 |
| - |
28 |
| - # Runs a single command using the runners shell |
29 |
| - - name: Run a one-line script |
30 |
| - run: echo Hello, world! |
31 |
| - |
32 |
| - # Runs a set of commands using the runners shell |
33 |
| - - name: Run a multi-line script |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + - name: Set up Python 3.8 |
| 25 | + uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: 3.8 |
| 28 | + - name: Cache |
| 29 | + uses: actions/cache@v2 |
| 30 | + with: |
| 31 | + path: ~/.cache/pip |
| 32 | + key: pip-flake8 |
| 33 | + - name: Install dependencies |
| 34 | + run: | |
| 35 | + python -m pip install --upgrade pip wheel |
| 36 | + python -m pip install --upgrade flake8 wemake-python-styleguide |
| 37 | + python -m pip install -r requirements.txt |
| 38 | + python -m pip install -r requirements-dev.txt |
| 39 | + - name: Run pytest |
34 | 40 | run: |
|
35 |
| - echo Add other actions to build, |
36 |
| - echo test, and deploy your project. |
| 41 | + pytest |
| 42 | + - name: Lint with flake8 |
| 43 | + run: | |
| 44 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 45 | + - name: Docstrings |
| 46 | + run: | |
| 47 | + flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=D,DAR |
| 48 | + - name: General stats |
| 49 | + run: | |
| 50 | + flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --ignore=I,P,WPS305,C812,E203,W503,E800,D,DAR,F |
| 51 | +
|
0 commit comments