-
Notifications
You must be signed in to change notification settings - Fork 52
57 lines (48 loc) · 1.38 KB
/
Codestyle-Check.yml
File metadata and controls
57 lines (48 loc) · 1.38 KB
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
name: Codestyle-Check
on:
pull_request:
branches:
- develop
jobs:
pre-commit:
name: Pre Commit
runs-on: ubuntu-latest
env:
PR_ID: ${{ github.event.pull_request.number }}
BRANCH: develop
steps:
- name: Cleanup
run: |
rm -rf * .[^.]*
- name: Clone GraphNet
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 1000
- name: Check bypass
id: check-bypass
uses: ./.github/actions/check-bypass
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
workflow-name: codestyle
- name: Merge PR to test branch
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
git fetch origin pull/${PR_ID}/merge
git checkout -b test FETCH_HEAD
- name: Setup python3.10
if: steps.check-bypass.outputs.can-skip != 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
pip install pre-commit==2.17.0
- name: Check pre-commit
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
set +e
bash -x tools/codestyle/pre_commit.sh;EXCODE=$?
exit $EXCODE