This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
chore: bump test and example version to 1.30.1 #184
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: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
java-version: | |
- 8 | |
- 11 | |
- 17 | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
fail-fast: false | |
name: Java ${{ matrix.java-version }} on ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
# with the latest setup-java action version, it is mandatory to select a Java distribution | |
# Eclipse Temurin seems to be the suggested distribution | |
distribution: 'temurin' | |
java-version: ${{ matrix.java-version }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Compile | |
run: ./gradlew assemble | |
# this step is required for Java version 16 and up, because some 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: dynatrace/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: dynatrace/build/reports/tests/test/ | |
all-passed: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: All checks passed | |
run: 'true' |