Skip to content

Commit b559fac

Browse files
committed
ci: migrate checking by CheckStyle from TravisCI to GitHub Actions
Part of #1154
1 parent ae0548b commit b559fac

File tree

3 files changed

+37
-28
lines changed

3 files changed

+37
-28
lines changed

.github/workflows/quality-checks.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Quality Checks
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
run-checkstyle:
8+
name: Run CheckStyle
9+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Clone source code
13+
uses: actions/[email protected] # https://github.com/actions/checkout
14+
with:
15+
# Whether to configure the token or SSH key with the local git config. Default: true
16+
persist-credentials: false
17+
- name: Install JDK
18+
uses: actions/[email protected] # https://github.com/actions/setup-java
19+
with:
20+
distribution: 'adopt' # https://github.com/actions/setup-java#supported-distributions
21+
java-version: '8' # https://github.com/actions/setup-java#supported-version-syntax
22+
cache: 'maven' # https://github.com/actions/setup-java#caching-packages-dependencies
23+
- name: Run CheckStyle
24+
run: ./src/main/scripts/execute-command.sh checkstyle

docs/external-dependencies.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# External Dependencies
22

3-
| Component | Production | Travis CI | docker-compose |
4-
| ------- | ------------------------ | --------------------- | ---------------------------------------- |
5-
| OS | Ubuntu 16.04.07 (Xenial) | Ubuntu 16.04 (Xenial) | |
6-
| JDK | OracleJDK 8u151 | OpenJDK 8u292 | OpenJDK 8u121-jre on Debian 8.11 (Jessy) |
7-
| MySQL | 5.7.27 | 5.7.33 | 5.7.20 on Debian 8.11 (Jessy) |
8-
| PostgreSQL | | 10.17 | 11.3 on Debian 9.13 (Stretch) |
9-
| Python | 2.7.12, 3.5.2 | 2.7.12, 3.5.2, 3.6.10 | |
10-
| bash | 4.3.14 | 4.3.48 | |
11-
| duplicity | 0.7.06 | | |
12-
| ansible | | 2.9.2 | |
3+
| Component | Production | GitHub Actions | docker-compose |
4+
| ------- | ------------------------ | ---------------------------- | ---------------------------------------- |
5+
| OS | Ubuntu 16.04.07 (Xenial) | Ubuntu 20.04.5 (Focal Fossa) | |
6+
| JDK | OracleJDK 8u151 | Adopt OpenJDK 8u292 | OpenJDK 8u121-jre on Debian 8.11 (Jessy) |
7+
| MySQL | 5.7.27 | | 5.7.20 on Debian 8.11 (Jessy) |
8+
| PostgreSQL | | | 11.3 on Debian 9.13 (Stretch) |
9+
| Python | 2.7.12, 3.5.2 | | |
10+
| bash | 4.3.14 | | |
11+
| duplicity | 0.7.06 | | |
12+
| maven | | 3.8.6 | |
13+
| ansible | | | |

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

+2-18
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-
CS_STATUS=
6261
PMD_STATUS=
6362
LICENSE_STATUS=
6463
POM_STATUS=
@@ -79,7 +78,6 @@ if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' ] && [ "${TRAVIS_PULL_REQUEST:-fal
7978
DANGER_STATUS=
8079
fi
8180

82-
CS_TIME=0
8381
PMD_TIME=0
8482
LICENSE_TIME=0
8583
POM_TIME=0
@@ -116,7 +114,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
116114
if [ -n "$MODIFIED_FILES" ]; then
117115
AFFECTS_POM_XML="$(echo "$MODIFIED_FILES" | grep -Fxq 'pom.xml' || echo 'no')"
118116
AFFECTS_TRAVIS_CFG="$(echo "$MODIFIED_FILES" | grep -Fxq '.travis.yml' || echo 'no')"
119-
AFFECTS_CS_CFG="$(echo "$MODIFIED_FILES" | grep -Eq '(checkstyle\.xml|checkstyle-suppressions\.xml)$' || echo 'no')"
120117
AFFECTS_SPOTBUGS_CFG="$(echo "$MODIFIED_FILES" | grep -q 'spotbugs-filter\.xml$' || echo 'no')"
121118
AFFECTS_PMD_XML="$(echo "$MODIFIED_FILES" | grep -q 'pmd\.xml$' || echo 'no')"
122119
AFFECTS_JS_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.js$' || echo 'no')"
@@ -125,7 +122,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
125122
AFFECTS_ROBOT_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.robot$' || echo 'no')"
126123
AFFECTS_SHELL_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.sh$' || echo 'no')"
127124
AFFECTS_GROOVY_FILES="$(echo "$MODIFIED_FILES" | grep -q '\.groovy$' || echo 'no')"
128-
AFFECTS_PROPERTIES="$(echo "$MODIFIED_FILES" | grep -q '\.properties$' || echo 'no')"
129125
AFFECTS_LICENSE_HEADER="$(echo "$MODIFIED_FILES" | grep -q 'license_header\.txt$' || echo 'no')"
130126
AFFECTS_PLAYBOOKS="$(echo "$MODIFIED_FILES" | grep -Eq '(vagrant|prod|deploy|bootstrap|/roles/.+)\.yml$' || echo 'no')"
131127

@@ -137,10 +133,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
137133
[ "$AFFECTS_SPOTBUGS_CFG" != 'no' ] || SPOTBUGS_STATUS=skip
138134
[ "$AFFECTS_PMD_XML" != 'no' ] || PMD_STATUS=skip
139135

140-
if [ "$AFFECTS_CS_CFG" = 'no' ] && [ "$AFFECTS_PROPERTIES" = 'no' ]; then
141-
CS_STATUS=skip
142-
fi
143-
144136
if [ "$AFFECTS_GROOVY_FILES" = 'no' ]; then
145137
TEST_STATUS=skip
146138

@@ -177,13 +169,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
177169

178170
echo
179171

180-
if [ "$CS_STATUS" != 'skip' ]; then
181-
START_TIME=$SECONDS
182-
"$EXEC_CMD" checkstyle >cs.log 2>&1 || CS_STATUS=fail
183-
CS_TIME=$((SECONDS - START_TIME))
184-
fi
185-
print_status "$CS_STATUS" "$CS_TIME" 'Run CheckStyle'
186-
187172
if [ "$PMD_STATUS" != 'skip' ]; then
188173
START_TIME=$SECONDS
189174
"$EXEC_CMD" pmd >pmd.log 2>&1 || PMD_STATUS=fail
@@ -292,7 +277,6 @@ fi
292277
print_status "$DANGER_STATUS" "$DANGER_TIME" 'Run danger'
293278

294279
if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
295-
[ "$CS_STATUS" = 'skip' ] || print_log cs.log 'Run CheckStyle'
296280
[ "$PMD_STATUS" = 'skip' ] || print_log pmd.log 'Run PMD'
297281
[ "$LICENSE_STATUS" = 'skip' ] || print_log license.log 'Check license headers'
298282
[ "$POM_STATUS" = 'skip' ] || print_log pom.log 'Check sorting of pom.xml'
@@ -314,8 +298,8 @@ if [ "$DANGER_STATUS" != 'skip' ]; then
314298
print_log danger.log 'Run danger'
315299
fi
316300

317-
rm -f cs.log pmd.log license.log 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
301+
rm -f pmd.log license.log 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
318302

319-
if echo "$CS_STATUS$PMD_STATUS$LICENSE_STATUS$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
303+
if echo "$PMD_STATUS$LICENSE_STATUS$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
320304
exit 1
321305
fi

0 commit comments

Comments
 (0)