-
Notifications
You must be signed in to change notification settings - Fork 4
195 lines (186 loc) · 5.54 KB
/
check.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Check
on: [ push, pull_request ]
env:
PIP_DISABLE_PIP_VERSION_CHECK: yes
jobs:
fix_stupid_mistakes:
name: Fix stupid mistakes
runs-on: ubuntu-latest
if: github.ref_type == 'branch'
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.GH_PUSH_TOKEN }}
- name: Fix stupid mistakes
uses: ./.github/actions/fix_stupid_mistakes
mypy:
name: mypy
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: Pipfile.lock
- name: Cache
uses: pat-s/always-upload-cache@v3
with:
path: .mypy_cache
key: mypy-${{ github.repository }}-${{ github.ref }}-${{ github.sha }}
restore-keys: mypy-${{ github.repository }}-${{ github.ref }}-
- name: Install libcurl4-openssl-dev for compiling PycURL
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install requirements
run: pip install -r pip-requirements.txt
- name: Install mypy + stuff required for checking the tests and setup.py
run: |
pip install -c pip-constraints.txt dulwich html5lib mypy numpy pytest pytest-is-running time-machine trove-classifiers
grep "^types-" pip-constraints.txt | xargs pip install
- name: Run mypy
run: mypy
flake8:
name: Flake8
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: Pipfile.lock
- name: Install Flake8
run: grep "^flake8-" pip-constraints.txt | xargs pip install -c pip-constraints.txt flake8 pep8-naming
- name: Run Flake8
run: flake8 --extend-ignore=SIM9
pylint:
name: Pylint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: Pipfile.lock
- name: Cache
uses: pat-s/always-upload-cache@v3
with:
path: ~/.cache/pylint
key: pylint-${{ github.repository }}-${{ github.ref }}-${{ github.sha }}
restore-keys: pylint-${{ github.repository }}-${{ github.ref }}-
- name: Install libcurl4-openssl-dev for compiling PycURL
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install requirements
run: pip install -r pip-requirements.txt
- name: Install Pylint + stuff required for checking the tests and setup.py
run: pip install -c pip-constraints.txt html5lib pylint pylint-pytest pytest time-machine trove-classifiers
- name: Run Pylint
run: pylint -r y -d fixme .
env:
DISABLE_PYSTON: 1
bandit:
name: Bandit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: Pipfile.lock
- name: Install Bandit
run: pip install -c pip-constraints.txt bandit[toml]
- name: Run Bandit
run: bandit -rc pyproject.toml .
eslint:
name: ESLint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.19.0
cache: pnpm
- name: Cache
uses: pat-s/always-upload-cache@v3
with:
path: .eslintcache
key: eslint-${{ github.repository }}-${{ github.ref }}-${{ github.sha }}
restore-keys: eslint-${{ github.repository }}-${{ github.ref }}-
- name: Install ESLint
run: pnpm install
- name: Run ESLint
run: pnpm eslint --cache .
tsc:
name: tsc
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.19.0
cache: pnpm
- name: Install tsc
run: pnpm install
- name: Run tsc
run: |
pnpm tsc -p an_website
pnpm tsc -p scripts
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -x -o all
with:
version: v0.9.0
check_together: yes
ignore_names: screenfetch