forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (104 loc) · 3.64 KB
/
lint.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
name: Lint
on: [push, pull_request]
jobs:
Salt:
name: Lint Salt's Source Code
runs-on: ubuntu-latest
container:
image: python:3.8.6-slim-buster
steps:
- name: Install System Deps
run: |
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
apt-get update
apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
apt-get install -y git/buster-backports
- uses: actions/checkout@v2
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
salt:
- added|modified:
- setup.py
- noxfile.py
- salt/**/*.py
- tasks/**/*.py
rcfile:
- added|modified:
- .pylintrc
- name: Install Python Requirements
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run:
nox --install-only --forcecolor -e lint-salt
- name: Lint Changed Files
if: github.event_name == 'pull_request' && steps.changed-files.outputs.salt == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-salt -- ${{ join(fromJSON(steps.changed-files.outputs.salt_files), ' ') }}
- name: Lint ALL Files
if: steps.changed-files.outputs.salt == 'true' || steps.changed-files.outputs.rcfile == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-salt
Tests:
name: Lint Salt's Test Suite
runs-on: ubuntu-latest
container:
image: python:3.8.6-slim-buster
steps:
- name: Install System Deps
run: |
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
apt-get update
apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
apt-get install -y git/buster-backports
- uses: actions/checkout@v2
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
tests:
- added|modified:
- tests/**/*.py
rcfile:
- added|modified:
- .pylintrc
- name: Install Python Requirements
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run:
nox --install-only --forcecolor -e lint-tests
- name: Lint Changed Files
if: github.event_name == 'pull_request' && steps.changed-files.outputs.tests == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-tests -- ${{ join(fromJSON(steps.changed-files.outputs.tests_files), ' ') }}
- name: Lint ALL Files
if: steps.changed-files.outputs.tests == 'true' || steps.changed-files.outputs.rcfile == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-tests