Add check-samples-gradle.yml for checking samples w/ Gradle. #4
This file contains hidden or 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: Check Samples (Gradle) | ||
| on: | ||
| workflow_dispatch: | ||
| jobs: | ||
| check_samples: | ||
| name: Check Samples project | ||
| if: ${{ github.repository == 'spring-projects/spring-grpc' }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - javaVersion: 25 | ||
| distribution: 'liberica' | ||
| - javaVersion: 17 | ||
| distribution: 'temurin' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Java ${{ matrix.javaVersion }} ${{ matrix.distribution }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ matrix.javaVersion }} | ||
| distribution: ${{ matrix.distribution }} | ||
| cache: gradle | ||
| - name: Build and run samples w/ Java 25 $ {{ matrix.distribution }} (non-kotlin) | ||
| if: ${{ matrix.javaVersion == 25 }} | ||
| run: | | ||
| pushd samples > dev/null | ||
| ./gradlew clean build \ | ||
| -x :grpc-server-kotlin:build \ | ||
| -PtestToolchain=25 \ | ||
| --rerun-tasks --no-build-cache \ | ||
| build | ||
| popd > dev/null | ||
| - name: Build and run samples w/ Java grpc-server-kotlin w/ Java 24 | ||
| if: ${{ matrix.javaVersion == 25 }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ matrix.javaVersion }} | ||
| distribution: ${{ matrix.distribution }} | ||
| cache: gradle | ||
| run: | | ||
| pushd samples > dev/null | ||
| ./gradlew :grpc-server-kotlin:build \ | ||
| -PtestToolchain=24 \ | ||
| --rerun-tasks --no-build-cache | ||
| - name: Build and run samples w/ Java ${{ matrix.javaVersion }} ${{ matrix.distribution }} | ||
| if: ${{ matrix.javaVersion != 25 }} | ||
| run: | | ||
| cd samples | ||
| ./gradlew clean build \ | ||
| -PtestToolchain="${{ matrix.javaVersion }}" \ | ||
| --rerun-tasks --no-build-cache | ||
| - name: Upload Build Reports (Java ${{ matrix.javaVersion }} ${{ matrix.distribution }}) | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results | ||
| path: '*/target/surefire-reports/*.*' | ||
| retention-days: 3 | ||