Skip to content

Update gradle/actions action to v4.2.1 (#1225) #1875

Update gradle/actions action to v4.2.1 (#1225)

Update gradle/actions action to v4.2.1 (#1225) #1875

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
JDK_DISTRIBUTION: zulu
JDK_VERSION_OLDEST: 17
JDK_VERSION_LATEST: 22
JDK_VERSION_LATEST_LTS: 21
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Set up JDKs
uses: actions/setup-java@v4
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: |
${{ env.JDK_VERSION_OLDEST }}
${{ env.JDK_VERSION_LATEST }}
${{ env.JDK_VERSION_LATEST_LTS }}
- name: Checkout
uses: actions/checkout@v4
- name: Set up Gradle
uses: gradle/actions/[email protected]
- name: Assemble and Check
run: >
./gradlew
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_${{ env.JDK_VERSION_OLDEST }}_X64,JAVA_HOME_${{ env.JDK_VERSION_LATEST }}_X64
assemble check
- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: build
path: |
./**/build/reports
/home/runner/work/doma/doma/.gradle
test:
name: Test (${{ matrix.driver }})
runs-on: ubuntu-latest
strategy:
matrix:
driver: [h2, mysql, mysql8, postgresql, sqlite, sqlserver, oracle]
timeout-minutes: 15
steps:
- name: Set up JDKs
uses: actions/setup-java@v4
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: |
${{ env.JDK_VERSION_OLDEST }}
${{ env.JDK_VERSION_LATEST }}
${{ env.JDK_VERSION_LATEST_LTS }}
- name: Checkout
uses: actions/checkout@v4
- name: Set up Gradle
uses: gradle/actions/[email protected]
- name: Test with the oldest JDK
run: >
./gradlew
-Pdriver=${{ matrix.driver }}
-PtestJavaLangVersion=${{ env.JDK_VERSION_OLDEST }}
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_${{ env.JDK_VERSION_OLDEST }}_X64,JAVA_HOME_${{ env.JDK_VERSION_LATEST }}_X64
integration-test-java:test
integration-test-kotlin:test
- name: Test with the latest JDK
run: >
./gradlew
-Pdriver=${{ matrix.driver }}
-PtestJavaLangVersion=${{ env.JDK_VERSION_LATEST }}
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_${{ env.JDK_VERSION_OLDEST }}_X64,JAVA_HOME_${{ env.JDK_VERSION_LATEST }}_X64
integration-test-java:test
integration-test-kotlin:test
- name: Test with the latest LTS JDK
run: >
./gradlew
-Pdriver=${{ matrix.driver }}
-PtestJavaLangVersion=${{ env.JDK_VERSION_LATEST_LTS }}
integration-test-java:test
integration-test-kotlin:test
- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-${{ matrix.driver }}
path: |
./**/build/reports
/home/runner/work/doma/doma/.gradle
publish:
if: github.event_name == 'push'
name: Publish
runs-on: ubuntu-latest
needs: [ build, test ]
timeout-minutes: 30
steps:
- name: Set up JDKs
uses: actions/setup-java@v4
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: |
${{ env.JDK_VERSION_OLDEST }}
${{ env.JDK_VERSION_LATEST }}
${{ env.JDK_VERSION_LATEST_LTS }}
- name: Checkout
uses: actions/checkout@v4
- name: Set up Gradle
uses: gradle/actions/[email protected]
- name: Publish packages
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
run: >
./gradlew
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_${{ env.JDK_VERSION_OLDEST }}_X64,JAVA_HOME_${{ env.JDK_VERSION_LATEST }}_X64
publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: publish
path: |
./**/build/reports
/home/runner/work/doma/doma/.gradle