Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/gradle_preview_jdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Preview-JDKs

on:
push:
branches: [ '4.x' ]
pull_request:
branches: [ '4.x' ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
jdk: [27] # add 28-ea etc. later

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 26
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'zulu'
java-version: '26'
cache: gradle

- name: Set up JDK ${{ matrix.jdk }}-ea
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '${{ matrix.jdk }}-ea'

- name: Cache Gradle packages
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run Validity Tests Upfront
env:
JDK_EXPERIMENTAL: ${{ matrix.jdk }}
JAVA_HOME: ${{ env.JAVA_HOME_26_X64 }}
run: ./gradlew test --tests "io.reactivex.rxjava4.validators.*" --stacktrace --no-daemon
- name: Build RxJava
env:
JDK_EXPERIMENTAL: ${{ matrix.jdk }}
JAVA_HOME: ${{ env.JAVA_HOME_26_X64 }}
run: ./gradlew build --stacktrace
- name: Generate Javadoc
env:
JDK_EXPERIMENTAL: ${{ matrix.jdk }}
JAVA_HOME: ${{ env.JAVA_HOME_26_X64 }}
run: ./gradlew javadoc --stacktrace

35 changes: 23 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id("java-library")
id("checkstyle")
id("eclipse")
id("jacoco")
id("maven-publish")
id("me.champeau.jmh") version "0.7.3"
id("com.github.hierynomus.license") version "0.16.1"
Expand Down Expand Up @@ -54,10 +53,17 @@ dependencies {
testRuntimeOnly "org.junit.platform:junit-platform-launcher:$jupiterLauncherVersion" // match your JUnit version family
}

// === Experimental JDK handling for Outreach Program ===
def experimental = System.getenv("JDK_EXPERIMENTAL")
def toolchainJdk = "26" // default / baseline

if (experimental != null && !experimental.trim().isEmpty()) {
toolchainJdk = experimental // e.g. "27"
}

java {
toolchain {
// vendor = JvmVendorSpec.ADOPTIUM <-- for now
languageVersion = JavaLanguageVersion.of(26)
languageVersion = JavaLanguageVersion.of(toolchainJdk)
}
sourceCompatibility = JavaVersion.VERSION_26
targetCompatibility = JavaVersion.VERSION_26
Expand Down Expand Up @@ -256,18 +262,23 @@ tasks.withType(Test) {
}
}

jacocoTestReport {
dependsOn test
dependsOn testNG

reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(true)
if (experimental == null || "".equals(experimental)) {
apply plugin: "jacoco"

jacocoTestReport {
dependsOn test
dependsOn testNG

reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(true)
}
}

check.dependsOn jacocoTestReport
}

check.dependsOn jacocoTestReport

checkstyle {
Comment thread
akarnokd marked this conversation as resolved.
configFile = project.file("config/checkstyle/checkstyle.xml")
Expand Down