Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit d814280

Browse files
authored
chore: Add maven clirr check (#1848)
* chore: Add maven clirr check * chore: Use Eclipse Termurin * chore: Change to Java 8 * chore: Add java 8 & 11 envs * chore: Skip Clirr and Enforcer check on install
1 parent f167479 commit d814280

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ on:
55
pull_request:
66
name: ci
77
jobs:
8+
clirr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-java@v3
13+
with:
14+
distribution: temurin
15+
java-version: 8
16+
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
17+
- uses: actions/setup-java@v3
18+
with:
19+
distribution: temurin
20+
java-version: 11
21+
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
22+
- run: .kokoro/maven-build.sh
23+
env:
24+
JOB_TYPE: clirr
825
maven-units:
926
name: "maven unit tests"
1027
runs-on: ubuntu-latest

.kokoro/maven-build.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,13 @@ fi
3737
echo "Compiling using Java:"
3838
java -version
3939
echo
40-
mvn -V -B -ntp clean install
40+
mvn -V -B -ntp clean install -DskipTests -Dclirr.skip=true -Denforcer.skip=true
4141

4242
# We ensure the generated class files are compatible with Java 8
4343
if [ ! -z "${JAVA8_HOME}" ]; then
4444
setJava "${JAVA8_HOME}"
4545
fi
4646

47-
echo "Running tests using Java:"
48-
java -version
49-
5047
if [ "${GITHUB_JOB}" == "units-java8" ]; then
5148
java -version 2>&1 | grep -q 'openjdk version "1.8.'
5249
MATCH=$? # 0 if the output has the match
@@ -56,6 +53,20 @@ if [ "${GITHUB_JOB}" == "units-java8" ]; then
5653
fi
5754
fi
5855

59-
echo
60-
# run tests in Java 8 with the source compiled in Java 11
61-
mvn -V -B -ntp surefire:test
56+
RETURN_CODE=0
57+
58+
case "${JOB_TYPE}" in
59+
test)
60+
# run tests in Java 8 with the source compiled in Java 11
61+
mvn -V -B -ntp surefire:test -Dclirr.skip=true -Denforcer.skip=true
62+
RETURN_CODE=$?
63+
;;
64+
clirr)
65+
mvn -B -ntp -Denforcer.skip=true clirr:check
66+
RETURN_CODE=$?
67+
;;
68+
*) ;;
69+
esac
70+
71+
echo "exiting with ${RETURN_CODE}"
72+
exit ${RETURN_CODE}

0 commit comments

Comments
 (0)