forked from rahul-deepsource/pyaction
-
Notifications
You must be signed in to change notification settings - Fork 10
/
action.yml
155 lines (149 loc) · 4.81 KB
/
action.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: "Python-lint-annotate: maintain code quality with annotated PRs and pushes"
description: "Zero-configuration GitHub Action to maintain code quality with push and PR annotations."
branding:
icon: "alert-triangle"
color: "yellow"
inputs:
python-root-list:
description: "A list of all paths to test"
required: false
default: "."
use-pylint:
description: "Use Pylint"
required: false
default: true
use-pycodestyle:
description: "Use pycodestyle"
required: false
default: true
use-flake8:
description: "Use Flake8"
required: false
default: true
use-black:
description: "Use Black"
required: false
default: true
use-mypy:
description: "Use mypy"
required: false
default: true
use-isort:
description: "Use isort"
required: false
default: true
use-vulture:
description: "Use vulture"
required: false
default: true
use-pydocstyle:
description: "Use pydocstyle"
required: false
default: true
extra-pylint-options:
description: "Extra options: pylint $(extra-pylint-options) $(python-root-list)"
required: false
default: ""
extra-pycodestyle-options:
description: "Extra options: pycodestyle $(extra-pycodestyle-options) $(python-root-list)"
required: false
default: ""
extra-flake8-options:
description: "Extra options: flake8 $(extra-flake8-options) $(python-root-list)"
required: false
default: ""
extra-black-options:
description: "Extra options: black --check $(extra-black-options) $(python-root-list)"
required: false
default: ""
extra-mypy-options:
description: "Extra options: mypy $(extra-mypy-options) $(python-root-list)"
required: false
default: ""
extra-isort-options:
description: "Extra options: isort -rc $(extra-isort-options) $(python-root-list) -c --diff "
required: false
default: ""
extra-vulture-options:
description: "Extra options: vulture $(extra-vulture-options) $(python-root-list)"
required: false
default: ""
extra-pydocstyle-options:
description: "Extra options: pydocstyle $(extra-pydocstyle-options) $(python-root-list)"
required: false
default: ""
python-version:
description: "Set desired python version with this keyword"
required: false
default: "3.8"
use-external-python:
description: "false (default): Install a new Python for this action; true: use the python installation in the previous steps"
type: boolean
required: false
default: false
runs:
using: "composite"
steps:
- name: Setup python
if: ${{ ! inputs.use-external-python }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
architecture: x64
cache: pip
- run: python --version
shell: bash
- name: Windows install dependencies
if: ${{ runner.os == 'Windows' }}
run: |
pip install -r ${{ github.action_path }}\requirements.txt --ignore-installed
echo "path_sep=" >> $GITHUB_ENV
shell: pwsh
- name: Posix install dependencies
if: ${{ runner.os != 'Windows' }}
run: pip install -r ${{ github.action_path }}/requirements.txt --ignore-installed
shell: bash
- name: Lint on Windows
if: ${{ runner.os == 'Windows' }}
run: >
${{ github.action_path }}\entrypoint.sh
'${{ inputs.python-root-list }}'
${{ inputs.use-pylint }}
${{ inputs.use-pycodestyle }}
${{ inputs.use-flake8 }}
${{ inputs.use-black }}
${{ inputs.use-mypy }}
${{ inputs.use-isort }}
${{ inputs.use-vulture }}
${{ inputs.use-pydocstyle }}
'${{ inputs.extra-pylint-options }}'
'${{ inputs.extra-pycodestyle-options }}'
'${{ inputs.extra-flake8-options }}'
'${{ inputs.extra-black-options }}'
'${{ inputs.extra-mypy-options }}'
'${{ inputs.extra-isort-options }}'
'${{ inputs.extra-vulture-options }}'
'${{ inputs.extra-pydocstyle-options }}'
shell: pwsh
- name: Lint on Linux
if: ${{ runner.os == 'Linux' }}
run: >
${{ github.action_path }}/entrypoint.sh
'${{ inputs.python-root-list }}'
${{ inputs.use-pylint }}
${{ inputs.use-pycodestyle }}
${{ inputs.use-flake8 }}
${{ inputs.use-black }}
${{ inputs.use-mypy }}
${{ inputs.use-isort }}
${{ inputs.use-vulture }}
${{ inputs.use-pydocstyle }}
'${{ inputs.extra-pylint-options }}'
'${{ inputs.extra-pycodestyle-options }}'
'${{ inputs.extra-flake8-options }}'
'${{ inputs.extra-black-options }}'
'${{ inputs.extra-mypy-options }}'
'${{ inputs.extra-isort-options }}'
'${{ inputs.extra-vulture-options }}'
'${{ inputs.extra-pydocstyle-options }}'
shell: bash