Library redesign #273
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java build with Gradle | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [ | |
8, | |
11, | |
17, | |
] | |
os: [ | |
ubuntu-latest, | |
windows-latest, | |
macos-latest, | |
] | |
name: Java ${{ matrix.java-version }} on ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java-version }} | |
- name: Compile | |
run: ./gradlew assemble | |
# this step is required for Java version 16 and up, because some of the internal classes used | |
# for the spotless plugin are no longer accessible. This is the official workaround provided | |
# on the google-java-format github page. | |
# these settings will cause Java 8 to crash, so they are only applied to later versions. | |
- name: Set up Gradle workaround for formatting and testing | |
if: ${{ matrix.java-version >= 16 }} | |
run: | | |
echo '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' > gradle.properties | |
- name: Test | |
run: ./gradlew check | |
- name: Upload JAR | |
# only run this action on ubuntu, since the jar should be the same | |
# for Windows and Linux, and therefore needs not be uploaded twice. | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jar (JDK ${{ matrix.java-version }}) | |
path: lib/build/libs/*.jar | |
if-no-files-found: error | |
- name: Upload unit test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: unit-tests-results (JDK ${{ matrix.java-version }} on ${{ matrix.os }}) | |
path: lib/build/reports/tests/test/ |