-
Notifications
You must be signed in to change notification settings - Fork 119
112 lines (92 loc) · 2.52 KB
/
linter.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
name: Linter
on:
push:
pull_request:
paths-ignore:
- '**.md'
jobs:
es-linter-for-ts:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install nodejs
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd setup/dashboard/ws || exit 1
npm ci
- name: Run linter
run: |
cd setup/dashboard/ws || exit 1
npm run lint
es-linter-for-js:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install nodejs
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd setup/dashboard || exit 1
npm ci --legacy-peer-deps
- name: Run linter
run: |
cd setup/dashboard || exit 1
npm run lint
php-linter:
runs-on: ubuntu-22.04
env:
PHP_CS_FIXER_IGNORE_ENV: 1
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: '8.0'
- name: Run linter
run: |
composer run-script lint
- name: Run PHPStan
run: |
composer run-script analyse
shell-linter:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run linter
uses: azohra/shell-linter@latest
with:
# todo: scripts in packages
path: "onekey.sh,setup.sh,bump-version.sh"
python-linter:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: env-version
run: |
echo "python=$(python -c 'import platform;print(platform.python_version())')" >> $GITHUB_OUTPUT
echo "ubuntu=$(lsb_release -cs)" >> $GITHUB_OUTPUT
- id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ steps.env-version.outputs.ubuntu }}-${{ steps.env-version.outputs.python }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
pipenv run flake8