Update README.md #181
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: Gradle CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# Basic Gradle wrapper validation. This step is run first, due to security | |
# concerns. Running our whole pipeline with Gradle with a corrupt wrapper, | |
# could expose our secrets, and we definitely want to prevent this. | |
validation: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
name: Gradle wrapper validation | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
# Basic Compliance check. Checks if codeStyle is correct and if reuse | |
# is applied correctly | |
compliance: | |
runs-on: ubuntu-latest | |
name: Compliance check | |
needs: validation | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v1 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Gradle build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: spotlessCheck | |
# One Basic check, for all kind of OS - to check if we have some kind of | |
# issue with any kind of OS | |
basic: | |
strategy: | |
matrix: | |
os: [ ubuntu, macos, windows ] | |
runs-on: ${{ matrix.os }}-latest | |
name: on ${{ matrix.os }} | |
needs: validation | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Gradle build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: check -x spotlessCheck | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.os }}-test-result | |
path: | | |
build/reports | |
build/test-results | |
# The check for different kind of gradle Versions | |
verify: | |
strategy: | |
matrix: | |
# https://gradle.org/releases/ | |
GRADLE_VERSION: | |
- "7.6.2" | |
- "8.0.2" | |
- "8.1.1" | |
- "8.2.1" | |
- "8.3" | |
runs-on: ubuntu-latest | |
needs: [basic, compliance] | |
name: with Gradle ${{ matrix.GRADLE_VERSION }} | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Setup Java JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Gradle build | |
uses: gradle/gradle-build-action@v2 | |
env: | |
GRADLE_VERSION: ${{ matrix.GRADLE_VERSION }} | |
with: | |
arguments: check -x spotlessCheck | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.GRADLE_VERSION }}-test-result | |
path: | | |
*/build/reports | |
*/build/test-results | |
publish: | |
runs-on: ubuntu-latest | |
needs: verify | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Setup Java JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Gradle build | |
uses: gradle/gradle-build-action@v2 | |
env: | |
GRADLE_PUBLISH_KEY: ${{secrets.PUBLISH_KEY}} | |
GRADLE_PUBLISH_SECRET: ${{secrets.PUBLISH_SECRET}} | |
with: | |
arguments: publishPlugins "-Pgradle.publish.key=${GRADLE_PUBLISH_KEY}" "-Pgradle.publish.secret=${GRADLE_PUBLISH_SECRET}" | |