From 86d094f4b3e29b99ab4496b2521654bc8b8e829c Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sat, 4 Mar 2023 18:07:53 +0100 Subject: [PATCH] Test... --- .github/workflows/build-jdk11.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/build.yaml | 2 +- to-11.sh | 12 +++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-jdk11.yaml diff --git a/.github/workflows/build-jdk11.yaml b/.github/workflows/build-jdk11.yaml new file mode 100644 index 00000000000..d13f4e3ff45 --- /dev/null +++ b/.github/workflows/build-jdk11.yaml @@ -0,0 +1,29 @@ +name: Build and verify with JDK 11 +on: + pull_request: + push: + branches: [ master ] +permissions: + contents: read +jobs: + transform-and-build: + runs-on: ubuntu-22.04 + steps: + - name: Check out code + uses: actions/checkout@v3.1.0 + - name: Set up JDK + uses: actions/setup-java@v3.8.0 + with: + java-version: | + 11.0.18 + 17.0.6 + distribution: temurin + cache: maven + - name: Transform the source code to be JDK 11 compatible + run: mvn -T1C install -DskipTests -Dverification.skip && ./to-11.sh + - name: Build project against vanilla Error Prone, compile Javadoc + run: JAVA_HOME="${JAVA_HOME_11_X64}" mvn -T1C clean install javadoc:jar -Dversion.jdk.test=11 + - name: Build project with self-check against Error Prone fork + run: JAVA_HOME="${JAVA_HOME_11_X64}" mvn -T1C clean verify -Perror-prone-fork -Pnon-maven-central -Pself-check -Dversion.jdk.test=11 -Derror-prone.self-check-args='-XepOpt:ErrorProneTestHelperSourceFormat:IgnoreMalformedCode=true -Xep:MethodReferenceUsage:OFF' -s settings.xml + - name: Remove installed project artifacts + run: mvn build-helper:remove-project-artifact diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 188450955e8..b038244de8d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ ubuntu-22.04 ] - jdk: [ 11.0.16, 17.0.4, 19 ] + jdk: [ 17.0.4, 19 ] distribution: [ temurin ] experimental: [ false ] include: diff --git a/to-11.sh b/to-11.sh index d7a609ceb7a..9b0909731e2 100755 --- a/to-11.sh +++ b/to-11.sh @@ -2,4 +2,14 @@ set -e -u -o pipefail -mvn clean test-compile fmt:format -T 1.0C -Perror-prone -Perror-prone-fork -Ppatch -Pself-check -Derror-prone.patch-checks=ErrorProneTestHelperSourceFormat -Derror-prone.self-check-args='-XepOpt:ErrorProneTestHelperSourceFormat:AvoidTextBlocks=true -Xep:MethodReferenceUsage:OFF' -Dverification.skip +# XXX: Clean this up. +mvn clean test-compile fmt:format \ + -s "$(dirname "${0}")/settings.xml" \ + -T 1.0C \ + -Perror-prone \ + -Perror-prone-fork \ + -Ppatch \ + -Pself-check \ + -Derror-prone.patch-checks=ErrorProneTestHelperSourceFormat \ + -Derror-prone.self-check-args='-XepOpt:ErrorProneTestHelperSourceFormat:AvoidTextBlocks=true -XepDisableAllChecks' \ + -Dverification.skip