Fix and test Java 8 compatibility when building from Java 21 or later. #766
Workflow file for this run
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 | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [17-jdk, 21-jdk] | |
runs-on: ubuntu-22.04 | |
container: | |
image: eclipse-temurin:${{ matrix.java }} | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./gradlew build publishToMavenLocal --stacktrace --warning-mode fail | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: build/libs/ | |
client_test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Run Auto test Client | |
uses: modmuss50/xvfb-action@v1 | |
with: | |
run: ./gradlew :minecraft:minecraft-test:runProductionAutoTestClient --stacktrace --warning-mode=fail | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: Client Test Screenshots | |
path: minecraft/minecraft-test/run/screenshots | |
smoke_test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Setup all the java versions we need | |
# Java 8 and 17 for running the smoke tests, we build loader on 21 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '8' | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: '21' | |
- run: ./gradlew :minecraft:minecraft-smoke-test:writeTestCommand --stacktrace --warning-mode fail | |
- run: chmod +x runSmokeTests.sh | |
- name: Run Smoke Tests | |
uses: modmuss50/xvfb-action@v1 | |
with: | |
run: ./runSmokeTests.sh |