-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.14 KB
/
Copy pathflake8.yml
File metadata and controls
64 lines (61 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: "Flake8 Workflow"
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:
permissions:
contents: "read"
pull-requests: "read"
jobs:
build:
runs-on: "ubuntu-24.04"
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v6"
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: "actions/setup-python@v6"
with:
python-version: ${{ matrix.python-version }}
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
# You can test your matrix by printing the current
# Python version
- name: "Display Python Version"
run: |
python -c "import sys; print(sys.version)"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
python -m pip install --no-cache-dir -r requirements.txt --upgrade
python -m pip install pytest
- name: "Install flake8"
run: |
python -m pip install flake8
- name: "Check flake8 Version"
run: |
python -m flake8 --version
- name: "Lint with flake8"
# yamllint disable rule:line-length
# stop the build if there are Python syntax errors or undefined names
# exit-zero treats all errors as warnings.
# The GitHub editor is 127 chars wide
# Changing the Ignore List
# W191 indentation contains tabs
run: |
python -m flake8 . --count --doctests --show-source --statistics