Skip to content

Commit 929a2a3

Browse files
xinydevaskervin
authored andcommitted
scripts/ci: enable static checks on Arm
- Enable static analysis checks on Arm. - Upgrade shellcheck-py to version 0.8.0.4 to provide Arm support. - Improve the way mdl searches for Markdown files to avoid scanning unintended directories, such as the local "vendor" folder. Signed-off-by: Xin Yang <[email protected]> Change-Id: Iae772b06785273086665ff2d6f49cc5a113d1f07 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk-csi/+/17967 Tested-by: SPDK CI Jenkins <[email protected]> Reviewed-by: Yibo Cai <[email protected]> Reviewed-by: Jing Yan <[email protected]> Reviewed-by: Antti Kervinen <[email protected]>
1 parent e11ed8b commit 929a2a3

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ shellcheck:
8080
mdl:
8181
@echo === running mdl
8282
@if hash mdl 2> /dev/null; then \
83-
find ./ -name "*.md" | xargs readlink -f | xargs mdl --style scripts/ci/mdl_rules.rb; \
83+
mdl --git-recurse --style scripts/ci/mdl_rules.rb .; \
8484
else \
8585
echo Markdown linter not found, please install; \
8686
false ; \

scripts/ci/common.sh

+11-16
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ function install_packages_ubuntu() {
102102
docker.io \
103103
conntrack \
104104
socat \
105-
wget
105+
wget \
106+
python3-pip \
107+
ruby \
108+
git
106109
systemctl start docker
107-
# install static check tools only on x86 agent
108-
if [ "$(arch)" == x86_64 ]; then
109-
apt-get install -y python3-pip ruby
110-
pip3 install yamllint==1.23.0 shellcheck-py==0.7.1.1
111-
fi
110+
111+
pip3 install yamllint==1.23.0 shellcheck-py==0.8.0.4
112112
gem install mdl -v 0.12.0
113113
}
114114

@@ -121,7 +121,9 @@ function install_packages_fedora() {
121121
bind-utils \
122122
socat \
123123
wget \
124-
ruby
124+
python3-pip \
125+
ruby \
126+
git
125127
if ! hash docker &> /dev/null; then
126128
dnf remove -y docker*
127129
dnf install -y dnf-plugins-core
@@ -132,11 +134,7 @@ function install_packages_fedora() {
132134
fi
133135
systemctl start docker
134136

135-
# install static check tools only on x86 agent
136-
if [ "$(arch)" == x86_64 ]; then
137-
dnf install -y python3-pip ruby
138-
pip3 install yamllint==1.23.0 shellcheck-py==0.7.1.1
139-
fi
137+
pip3 install yamllint==1.23.0 shellcheck-py==0.8.0.4
140138
gem install mdl -v 0.12.0
141139
}
142140

@@ -281,10 +279,7 @@ function build_spdkcsi() {
281279
make clean
282280
echo "======== build spdkcsi ========"
283281
make -C "${ROOTDIR}" spdkcsi
284-
if [ "$(arch)" == "x86_64" ]; then
285-
echo "======== static check ========"
286-
make -C "${ROOTDIR}" lint
287-
fi
282+
make -C "${ROOTDIR}" lint
288283
echo "======== build container ========"
289284
# XXX: should match image name:tag in Makefile
290285
sudo docker rmi spdkcsi/spdkcsi:canary > /dev/null || :

scripts/golangci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
# options for analysis running
1212
run:
13-
# default concurrency is a available CPU number
14-
concurrency: 2
13+
# The default concurrency value is the number of available CPU.
14+
# concurrency: 2
1515

1616
# timeout for analysis, e.g. 30s, 5m, default is 1m
1717
timeout: 5m

0 commit comments

Comments
 (0)