Skip to content

4.x: Add optional build/test for future JDKs #4

4.x: Add optional build/test for future JDKs

4.x: Add optional build/test for future JDKs #4

# 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:
strategy:
fail-fast: false # important: don't cancel other matrix jobs on failure
matrix:
java-version:
- 27-ea # experimental/upcoming - allowed to fail
include:
- java-version: 27-ea
distribution: temurin
experimental: true
runs-on: ubuntu-latest
env:
jdk: ${{ matrix.java-version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'zulu'
java-version: '26'
cache: gradle
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: ${{ matrix.distribution || 'temurin' }}
java-version: ${{ matrix.java-version }}
cache: gradle
- 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
run: ./gradlew test --tests "io.reactivex.rxjava4.validators.*" --stacktrace --no-daemon
- name: Build RxJava
run: ./gradlew build --stacktrace
- name: Generate Javadoc
run: ./gradlew javadoc --stacktrace
continue-on-error: ${{ matrix.experimental || false }}