-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (51 loc) · 1.71 KB
/
action.yml
File metadata and controls
53 lines (51 loc) · 1.71 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
name: Lint & Test
inputs:
python_version:
default: '3.x'
type: string
input_pkg_name:
required: true
type: string
extra_packages:
type: string
runs:
using: composite
steps:
- name: Set up Python ${{ inputs.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
check-latest: true
- name: Install Latest pip and setuptools
run: python -m pip install -U pip setuptools wheel
shell: bash
- name: Install Linters
run: |
python -m pip install -U flake8 flake8-colors
python -m pip install -U flake8-import-order pep8-naming
python -m pip install -U pydocstyle pylint
shell: bash
- name: Install Extra Dependencies ${{ inputs.extra_packages }}
run: python -m pip install -U ${{ inputs.extra_packages }}
shell: bash
- name: Run Flake8 Checks
run: python -m flake8
shell: bash
- name: Run PyLint Checks on ${{ inputs.input_pkg_name }}
run: python -m pylint -d duplicate-code ${{ inputs.input_pkg_name }}
shell: bash
- name: PyDocStyle
run: python -m pydocstyle
shell: bash
- name: Install local ${{ inputs.input_pkg_name }} pkg in editable mode
run: python -m pip install -e ${{ inputs.input_pkg_name }}
shell: bash
- name: Execute Unit Tests
run: python -m unittest discover -s ./test*
shell: bash
- name: Check Version Updated in setup.py Before Merging
if: ${{ github.event_name == 'pull_request' }}
run: |
test -n "$(git diff -G version= origin/master HEAD -- setup.py)" || \
exit "Package version in setup.py must be incremented before merge."
shell: bash