-
Notifications
You must be signed in to change notification settings - Fork 1.3k
118 lines (98 loc) · 3.69 KB
/
python-style-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
name: Python Style Check
# Cancel previous runs in the PR when you push new commits
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
# Controls when the action will run.
on:
push:
branches: [ main ]
paths:
- 'python/**'
- '.github/workflows/python-style-check.yml'
pull_request:
branches: [ main ]
paths:
- 'python/**'
- '.github/workflows/python-style-check.yml'
schedule:
- cron: '0 16 * * *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
style-check:
# The type of runner that the job will run on
runs-on: [ self-hosted, Gondolin, ubuntu-20.04-lts ]
strategy:
matrix:
python-version: [3.7]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install pycodestyle
pip install pydocstyle
pip install mypy==0.982
pip install wheel
# Runs a single command using the runners shell
- name: License checking
run: bash python/dev/check-license
- name: Nano style checking
run: |
bash python/nano/test/run-nano-codestyle-test.sh
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Nano type checking [pytorch]
run: |
bash python/nano/dev/build_and_install.sh linux default false pytorch
pip uninstall bigdl-nano -y
rm -rf python/nano/src/build python/nano/src/dist python/nano/src/*egg-info
bash python/nano/test/run-nano-type-test.sh
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Nano type checking [tensorflow]
run: |
bash python/nano/dev/build_and_install.sh linux default false tensorflow
pip uninstall bigdl-nano -y
rm -rf python/nano/src/build python/nano/src/dist python/nano/src/*egg-info
bash python/nano/test/run-nano-type-test.sh
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Dllib style checking
run: bash python/dllib/dev/lint-python
- name: Orca style checking
run: bash python/orca/dev/test/lint-python
- name: Orca type checking
run: bash python/orca/dev/test/run-type-check.sh
env:
BIGDL_HOME: ${{ github.workspace }}
- name: Friesian style checking
run: bash python/friesian/dev/test/lint-python
- name: Chronos style checking
run: bash python/chronos/dev/test/lint-python
- name: Nano style checking
run: bash python/nano/dev/lint-python
- name: PPML style checking
run: bash python/ppml/dev/lint-python
- name: Serving style checking
run: bash python/serving/dev/lint-python
- name: LLM style checking
run: bash python/llm/dev/test/lint-python
create-workflow-badge:
if: github.event.pull_request == ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: create workflow badge
if: ${{ always() }}
uses: ./.github/actions/create-job-status-badge
with:
secret: ${{ secrets.GIST_SECRET }}
gist-id: 515298657716ead4615f539244730bf0
file-name: python-style-check.json
type: workflow