-
Notifications
You must be signed in to change notification settings - Fork 919
141 lines (133 loc) · 5.7 KB
/
style.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Style
on:
pull_request:
branches:
- master
- branch-*
concurrency:
group: linter-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linter:
name: Style check
runs-on: ubuntu-22.04
strategy:
matrix:
profiles:
- '-Pflink-provided,hive-provided,spark-provided,spark-3.5,spark-3.4,spark-3.3,tpcds,kubernetes-it'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
- name: Check kyuubi modules avaliable
id: modules-check
run: build/mvn dependency:resolve -DincludeGroupIds="org.apache.kyuubi" -DincludeScope="compile" -DexcludeTransitive=true ${{ matrix.profiles }}
continue-on-error: true
- name: Install
# When a continue-on-error step fails, the outcome is failure, but the final conclusion is success.
# for more details, please visit: https://github.com/actions/toolkit/issues/399#issuecomment-666147717
if: steps.modules-check.conclusion == 'success' && steps.modules-check.outcome == 'failure'
run: |
MVN_OPT="-DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip"
build/mvn clean install ${MVN_OPT} -Pflink-provided,hive-provided,spark-provided,tpcds
build/mvn clean install ${MVN_OPT} -pl extensions/spark/kyuubi-extension-spark-3-3 -Pspark-3.3
build/mvn clean install ${MVN_OPT} -pl extensions/spark/kyuubi-extension-spark-3-4 -Pspark-3.4
build/mvn clean install ${MVN_OPT} -pl extensions/spark/kyuubi-extension-spark-3-5,extensions/spark/kyuubi-spark-connector-hive -Pspark-3.5
- name: Scalastyle with maven
id: scalastyle-check
run: |
build/mvn scalastyle:check ${{ matrix.profiles }}
- name: Print scalastyle error report
if: failure() && steps.scalastyle-check.outcome != 'success'
run: >-
for log in `find * -name "scalastyle-output.xml"`;
do
if grep -q "error" $log; then
cat $log;
fi
done
- name: Spotless style check
run: |
SPOTLESS_BLACK_VERSION=$(build/mvn help:evaluate -Dexpression=spotless.python.black.version -q -DforceStdout)
pip install black==$SPOTLESS_BLACK_VERSION
build/mvn spotless:check ${{ matrix.profiles }} -Pspotless-python
- name: Get NodeJS and PNPM version
run: |
NODEJS_VERSION=$(build/mvn help:evaluate -Dexpression=node.version -q -DforceStdout)
PNPM_VERSION=$(build/mvn help:evaluate -Dexpression=pnpm.version -q -DforceStdout)
echo "NODEJS_VERSION=${NODEJS_VERSION}" >> "$GITHUB_ENV"
echo "PNPM_VERSION=${PNPM_VERSION}" >> "$GITHUB_ENV"
- name: setup npm
uses: actions/setup-node@v4
with:
node-version: ${{env.NODEJS_VERSION}}
- name: Web UI Style with node
run: |
cd ./kyuubi-server/web-ui
npm install pnpm@${PNPM_VERSION} -g
pnpm install --frozen-lockfile
pnpm run lint
echo "---------------------------------------Notice------------------------------------"
echo "If this style check fail, you should follow these commands for a tentative fix"
echo "* cd ./kyuubi-server/web-ui"
echo "* npm run lint-fix"
echo "Following the above steps can solve many style problems. "
echo "If there is a problem that cannot be fixed by the command, "
echo "you need to manually fix it by following the information told by the command above"
echo "---------------------------------------------------------------------------------"
- name: Super Linter Checks
uses: github/super-linter/slim@v7
env:
CREATE_LOG_FILE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GENERATED_FILES: true
IGNORE_GITIGNORED_FILES: true
LINTER_RULES_PATH: /
LOG_LEVEL: NOTICE
SUPPRESS_POSSUM: true
VALIDATE_BASH_EXEC: true
VALIDATE_JSONC: true
VALIDATE_POWERSHELL: true
VALIDATE_XML: true
- name: Upload Super Linter logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: super-linter-log
path: super-linter.log
- name: check bin directory
uses: ludeeus/[email protected]
with:
# TODO: enable for all folders step by step
scandir: './bin'
severity: error