Also build and test on Java 17 and 21 (#1525) #313
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: Build FitNesse | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [ '11', '17', '21' ] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java-version }} | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Remove Java 21 incompatible tests | |
if: ${{ matrix.java-version == '21' }} | |
run: rm -rf FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/SystemExitIsPrevented | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: build slimJar sourcesJar javadocJar | |
# Only write to the cache for builds on the 'master' branch. | |
# Builds on other branches will only read existing entries from the cache. | |
cache-read-only: ${{ github.ref != 'refs/heads/master' }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libs-java-${{ matrix.java-version }} | |
path: build/libs | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
junit_files: build/test-results/test/*.xml |