From 119f25f5b3393f0f71da78aa695c0b1b2dfd7d6c Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Wed, 15 Dec 2021 09:58:54 +0100 Subject: [PATCH] Add github check action, update forbidden-apis. --- .github/workflows/on-commit.yml | 58 +++++++++++++++++++++++++++++++++ build.gradle | 2 +- gradle.properties | 9 +++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/on-commit.yml diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml new file mode 100644 index 000000000..e970652cc --- /dev/null +++ b/.github/workflows/on-commit.yml @@ -0,0 +1,58 @@ +name: On Commit Checks + +on: + pull_request: + branches: + - master + + push: + branches: + - master + +jobs: + tests: + name: gradle check (JDK ${{ matrix.java }} on ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + # Check on latest ubuntu with the lowest supported JDK. Everything else + # is handled by subsequent nightly tests. + matrix: + os: [ ubuntu-latest ] + java: [ '11', '17' ] + + steps: + - name: Correct git autocrlf + run: git config --global core.autocrlf false + + - name: Git checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'adopt-hotspot' + java-version: ${{ matrix.java }} + java-package: jdk + + - name: Cache/Restore Gradle files + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/jdks + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('versions.lock', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-caches- + + - name: Tests (./gradlew ... check) + run: ./gradlew --max-workers 4 check + + - name: Store failed test outputs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: failed-test-outputs + path: '**/OUTPUT-*.txt' diff --git a/build.gradle b/build.gradle index 2efa6ddc6..561c9a441 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id "com.github.ben-manes.versions" version "0.28.0" - id 'de.thetaphi.forbiddenapis' version '3.0.1' apply false + id 'de.thetaphi.forbiddenapis' version '3.2' apply false id "me.champeau.gradle.jmh" version "0.5.0" apply false } diff --git a/gradle.properties b/gradle.properties index a47b68a35..a207f9869 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,3 +6,12 @@ org.gradle.workers.max=4 systemProp.org.gradle.internal.http.connectionTimeout=300000 systemProp.org.gradle.internal.http.socketTimeout=300000 + +# Set up jvm arguments for gradle. +# Open up internal compiler modules for spotless/ google java format. +org.gradle.jvmargs= \ + --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED