forked from middlewarehq/middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.73 KB
/
pre-commit.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
name: Linting-Precommit
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.po", "**.json"]'
linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js 22
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install dependencies for cli
run: yarn add eslint@^8.40.0 eslint-plugin-import@^2.29.0 eslint-plugin-prettier@^5.0.1 eslint-plugin-react@^7.29.4 eslint-plugin-unused-imports@^3.0.0 --dev
working-directory: cli
- name: Install dependencies for web-server
run: yarn add eslint@^8.40.0 [email protected] eslint-plugin-import@^2.29.0 eslint-plugin-prettier@^5.0.1 eslint-plugin-react@^7.29.4 eslint-plugin-unused-imports@^3.0.0 --dev
working-directory: web-server
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install pre-commit
run: |
source venv/bin/activate
python -m pip install pre-commit
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
with:
extra_args: --all-files