diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 29ccc4023..89a99957f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,23 @@ on: pull_request: name: ci jobs: + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - run: .kokoro/maven-build.sh + env: + JOB_TYPE: clirr maven-units: name: "maven unit tests" runs-on: ubuntu-latest diff --git a/.kokoro/maven-build.sh b/.kokoro/maven-build.sh index ae98dcbbd..f8a1511ef 100755 --- a/.kokoro/maven-build.sh +++ b/.kokoro/maven-build.sh @@ -37,16 +37,13 @@ fi echo "Compiling using Java:" java -version echo -mvn -V -B -ntp clean install +mvn -V -B -ntp clean install -DskipTests -Dclirr.skip=true -Denforcer.skip=true # We ensure the generated class files are compatible with Java 8 if [ ! -z "${JAVA8_HOME}" ]; then setJava "${JAVA8_HOME}" fi -echo "Running tests using Java:" -java -version - if [ "${GITHUB_JOB}" == "units-java8" ]; then java -version 2>&1 | grep -q 'openjdk version "1.8.' MATCH=$? # 0 if the output has the match @@ -56,6 +53,20 @@ if [ "${GITHUB_JOB}" == "units-java8" ]; then fi fi -echo -# run tests in Java 8 with the source compiled in Java 11 -mvn -V -B -ntp surefire:test +RETURN_CODE=0 + +case "${JOB_TYPE}" in +test) + # run tests in Java 8 with the source compiled in Java 11 + mvn -V -B -ntp surefire:test -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +clirr) + mvn -B -ntp -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) ;; +esac + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} \ No newline at end of file