Skip to content

Commit d96b8c0

Browse files
committed
ci: migrate checking of pom.xml from TravisCI to GitHub Actions
Part of #1154
1 parent 4392b67 commit d96b8c0

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.github/workflows/quality-checks.yml

+18
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,21 @@ jobs:
5858
cache: 'maven' # https://github.com/actions/setup-java#caching-packages-dependencies
5959
- name: Check license header
6060
run: ./src/main/scripts/execute-command.sh check-license
61+
check-pom:
62+
name: Check pom.xml
63+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
64+
runs-on: ubuntu-20.04
65+
steps:
66+
- name: Clone source code
67+
uses: actions/[email protected] # https://github.com/actions/checkout
68+
with:
69+
# Whether to configure the token or SSH key with the local git config. Default: true
70+
persist-credentials: false
71+
- name: Install JDK
72+
uses: actions/[email protected] # https://github.com/actions/setup-java
73+
with:
74+
distribution: 'adopt' # https://github.com/actions/setup-java#supported-distributions
75+
java-version: '8' # https://github.com/actions/setup-java#supported-version-syntax
76+
cache: 'maven' # https://github.com/actions/setup-java#caching-packages-dependencies
77+
- name: Check pom.xml
78+
run: ./src/main/scripts/execute-command.sh check-pom

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

+2-13
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-
POM_STATUS=
6261
BOOTLINT_STATUS=
6362
RFLINT_STATUS=
6463
SHELLCHECK_STATUS=
@@ -76,7 +75,6 @@ if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' ] && [ "${TRAVIS_PULL_REQUEST:-fal
7675
DANGER_STATUS=
7776
fi
7877

79-
POM_TIME=0
8078
BOOTLINT_TIME=0
8179
RFLINT_TIME=0
8280
SHELLCHECK_TIME=0
@@ -120,7 +118,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
120118
AFFECTS_PLAYBOOKS="$(echo "$MODIFIED_FILES" | grep -Eq '(vagrant|prod|deploy|bootstrap|/roles/.+)\.yml$' || echo 'no')"
121119

122120
if [ "$AFFECTS_POM_XML" = 'no' ]; then
123-
POM_STATUS=skip
124121
ENFORCER_STATUS=skip
125122

126123
if [ "$AFFECTS_JAVA_FILES" = 'no' ]; then
@@ -160,13 +157,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
160157

161158
echo
162159

163-
if [ "$POM_STATUS" != 'skip' ]; then
164-
START_TIME=$SECONDS
165-
"$EXEC_CMD" check-pom >pom.log 2>&1 || POM_STATUS=fail
166-
POM_TIME=$((SECONDS - START_TIME))
167-
fi
168-
print_status "$POM_STATUS" "$POM_TIME" 'Check sorting of pom.xml'
169-
170160
if [ "$BOOTLINT_STATUS" != 'skip' ]; then
171161
START_TIME=$SECONDS
172162
"$EXEC_CMD" bootlint >bootlint.log 2>&1 || BOOTLINT_STATUS=fail
@@ -254,7 +244,6 @@ fi
254244
print_status "$DANGER_STATUS" "$DANGER_TIME" 'Run danger'
255245

256246
if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
257-
[ "$POM_STATUS" = 'skip' ] || print_log pom.log 'Check sorting of pom.xml'
258247
[ "$BOOTLINT_STATUS" = 'skip' ] || print_log bootlint.log 'Run bootlint'
259248
[ "$RFLINT_STATUS" = 'skip' ] || print_log rflint.log 'Run robot framework lint'
260249
[ "$SHELLCHECK_STATUS" = 'skip' ] || print_log shellcheck.log 'Run shellcheck'
@@ -273,8 +262,8 @@ if [ "$DANGER_STATUS" != 'skip' ]; then
273262
print_log danger.log 'Run danger'
274263
fi
275264

276-
rm -f pom.log bootlint.log rflint.log shellcheck.log jest.log validator.log enforcer.log test.log codenarc.log spotbugs.log verify.log danger.log ansible_lint.log
265+
rm -f bootlint.log rflint.log shellcheck.log jest.log validator.log enforcer.log test.log codenarc.log spotbugs.log verify.log danger.log ansible_lint.log
277266

278-
if echo "$POM_STATUS$BOOTLINT_STATUS$RFLINT_STATUS$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
267+
if echo "$BOOTLINT_STATUS$RFLINT_STATUS$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
279268
exit 1
280269
fi

0 commit comments

Comments
 (0)