File tree 2 files changed +47
-6
lines changed
2 files changed +47
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Lint
2
+
3
+ on :
4
+ push :
5
+ workflow_call :
6
+ inputs :
7
+ working-directory :
8
+ type : string
9
+ required : false
10
+ default : ' .'
11
+
12
+ jobs :
13
+ pre-commit :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout repository
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Set up Python
20
+ id : setup-python
21
+ uses : actions/setup-python@v5
22
+ with :
23
+ python-version : ' 3.12'
24
+ cache : ' pip'
25
+
26
+ - uses : actions/cache@v4
27
+ with :
28
+ path : ~/.cache/pre-commit
29
+ key : >
30
+ ${{ format('pre-commit-{0}-{1}',
31
+ steps.setup-python.outputs.python-version,
32
+ hashFiles('.pre-commit-config.yaml')
33
+ ) }}
34
+
35
+ - name : Install pre-commit
36
+ run : |
37
+ pip install --upgrade pip
38
+ pip install pre-commit
39
+ pre-commit install
40
+
41
+ - name : Run pre-commit hooks
42
+ working-directory : ${{ inputs.working-directory }}
43
+ run : |
44
+ git ls-files | xargs pre-commit run \
45
+ --show-diff-on-failure \
46
+ --color=always \
47
+ --files
Original file line number Diff line number Diff line change 34
34
python -m pip install --upgrade pip
35
35
pip install -r requirements.txt
36
36
37
- - name : Run pre-commit hooks
38
- run : |
39
- pip install -r requirements-dev.txt
40
- pre-commit install
41
- pre-commit run --all-files
42
-
43
37
- name : Run unit tests with pytest
44
38
env :
45
39
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments