Skip to content

Commit 69629b8

Browse files
committed
ci: migrate checking by shellcheck from TravisCI to GitHub Actions
Part of #1154
1 parent e5ec6d4 commit 69629b8

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

Diff for: .github/workflows/quality-checks.yml

+14
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,17 @@ jobs:
114114
robotframework-lint==1.1
115115
- name: Run rflint
116116
run: ./src/main/scripts/execute-command.sh rflint
117+
run-shellcheck:
118+
name: Run ShellCheck
119+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
120+
runs-on: ubuntu-20.04
121+
steps:
122+
- name: Clone source code
123+
uses: actions/[email protected] # https://github.com/actions/checkout
124+
with:
125+
# Whether to configure the token or SSH key with the local git config. Default: true
126+
persist-credentials: false
127+
- name: Show shellcheck version
128+
run: shellcheck --version
129+
- name: Run shellcheck
130+
run: ./src/main/scripts/execute-command.sh shellcheck

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before_script:
2222
cp src/main/resources/test/test.png /tmp/uploads/1.png;
2323
sudo add-apt-repository -y ppa:jblgf0/python;
2424
sudo apt-get -qq update;
25-
sudo apt-get install -y shellcheck python3.6 python3-pip;
25+
sudo apt-get install -y python3.6 python3-pip;
2626
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py | sudo -H python3.6;
2727
pip3 install --user \
2828
html5validator==0.4.2 \

Diff for: src/main/scripts/ci/check-build-and-verify.sh

+2-15
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ if [ "${1:-}" = '--only-integration-tests' ]; then
5858
RUN_ONLY_INTEGRATION_TESTS=yes
5959
fi
6060

61-
SHELLCHECK_STATUS=
6261
JEST_STATUS=
6362
HTML_STATUS=
6463
ENFORCER_STATUS=
@@ -73,7 +72,6 @@ if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' ] && [ "${TRAVIS_PULL_REQUEST:-fal
7372
DANGER_STATUS=
7473
fi
7574

76-
SHELLCHECK_TIME=0
7775
JEST_TIME=0
7876
HTML_TIME=0
7977
ENFORCER_TIME=0
@@ -108,7 +106,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
108106
AFFECTS_JS_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.js$' || echo 'no')"
109107
AFFECTS_HTML_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.html$' || echo 'no')"
110108
AFFECTS_JAVA_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.java$' || echo 'no')"
111-
AFFECTS_SHELL_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.sh$' || echo 'no')"
112109
AFFECTS_GROOVY_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.groovy$' || echo 'no')"
113110
AFFECTS_PLAYBOOKS="$(echo "$MODIFIED_FILES" | grep -Eq '(vagrant|prod|deploy|bootstrap|/roles/.+)\.yml$' || echo 'no')"
114111

@@ -131,8 +128,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
131128
if [ "$AFFECTS_HTML_FILES" = 'no' ]; then
132129
HTML_STATUS=skip
133130
fi
134-
[ "$AFFECTS_SHELL_FILES" != 'no' ] || SHELLCHECK_STATUS=skip
135-
136131
if [ "$AFFECTS_PLAYBOOKS" = 'no' ]; then
137132
ANSIBLE_LINT_STATUS=skip
138133
fi
@@ -150,13 +145,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
150145

151146
echo
152147

153-
if [ "$SHELLCHECK_STATUS" != 'skip' ]; then
154-
START_TIME=$SECONDS
155-
"$EXEC_CMD" shellcheck >shellcheck.log 2>&1 || SHELLCHECK_STATUS=fail
156-
SHELLCHECK_TIME=$((SECONDS - START_TIME))
157-
fi
158-
print_status "$SHELLCHECK_STATUS" "$SHELLCHECK_TIME" 'Run shellcheck'
159-
160148
if [ "$JEST_STATUS" != 'skip' ]; then
161149
START_TIME=$SECONDS
162150
"$EXEC_CMD" jest >jest.log 2>&1 || JEST_STATUS=fail
@@ -223,7 +211,6 @@ fi
223211
print_status "$DANGER_STATUS" "$DANGER_TIME" 'Run danger'
224212

225213
if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
226-
[ "$SHELLCHECK_STATUS" = 'skip' ] || print_log shellcheck.log 'Run shellcheck'
227214
[ "$JEST_STATUS" = 'skip' ] || print_log jest.log 'Run JavaScript unit tests'
228215
[ "$HTML_STATUS" = 'skip' ] || print_log validator.log 'Run html5validator'
229216
[ "$ENFORCER_STATUS" = 'skip' ] || print_log enforcer.log 'Run maven-enforcer-plugin'
@@ -239,8 +226,8 @@ if [ "$DANGER_STATUS" != 'skip' ]; then
239226
print_log danger.log 'Run danger'
240227
fi
241228

242-
rm -f shellcheck.log jest.log validator.log enforcer.log test.log codenarc.log spotbugs.log verify.log danger.log ansible_lint.log
229+
rm -f jest.log validator.log enforcer.log test.log codenarc.log spotbugs.log verify.log danger.log ansible_lint.log
243230

244-
if echo "$SHELLCHECK_STATUS$JEST_STATUS$HTML_STATUS$ENFORCER_STATUS$TEST_STATUS$CODENARC_STATUS$SPOTBUGS_STATUS$VERIFY_STATUS$DANGER_STATUS$ANSIBLE_LINT_STATUS" | grep -Fqs 'fail'; then
231+
if echo "$JEST_STATUS$HTML_STATUS$ENFORCER_STATUS$TEST_STATUS$CODENARC_STATUS$SPOTBUGS_STATUS$VERIFY_STATUS$DANGER_STATUS$ANSIBLE_LINT_STATUS" | grep -Fqs 'fail'; then
245232
exit 1
246233
fi

0 commit comments

Comments
 (0)