Skip to content

Commit

Permalink
Add github check action, update forbidden-apis.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Dec 15, 2021
1 parent 556d16a commit 119f25f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/on-commit.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 119f25f

Please sign in to comment.