Update builder
This commit is contained in:
+18
-10
@@ -9,8 +9,12 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build JAR & Run Tests
|
||||
name: Build JAR & Run Tests (Java ${{ matrix.java }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java: [ '11', '17', '21' ]
|
||||
|
||||
steps:
|
||||
- name: Configure Dynamic DNS Resolvers
|
||||
@@ -23,21 +27,21 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Java JDK (Temurin 17)
|
||||
- name: Set up Java JDK (Temurin ${{ matrix.java }})
|
||||
uses: actions/setup-java@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
java-version: '17'
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Ensure Java Available
|
||||
run: |
|
||||
if ! command -v javac >/dev/null 2>&1; then
|
||||
echo "Installing OpenJDK 17 via package manager..."
|
||||
echo "Installing OpenJDK ${{ matrix.java }} via package manager..."
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update && apt-get install -y openjdk-17-jdk-headless || true
|
||||
apt-get update && apt-get install -y openjdk-${{ matrix.java }}-jdk-headless || true
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache openjdk17 || true
|
||||
apk add --no-cache openjdk${{ matrix.java }} || true
|
||||
fi
|
||||
fi
|
||||
echo "Java compiler:"
|
||||
@@ -53,23 +57,27 @@ jobs:
|
||||
run: |
|
||||
sh ./test_all.sh
|
||||
|
||||
- name: Prepare Versioned JAR
|
||||
run: |
|
||||
cp build/j3270.jar "build/j3270-java${{ matrix.java }}.jar"
|
||||
|
||||
- name: Upload j3270 Executable JAR Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: j3270-executable-jar
|
||||
path: build/j3270.jar
|
||||
name: j3270-java${{ matrix.java }}-jar
|
||||
path: build/j3270-java${{ matrix.java }}.jar
|
||||
|
||||
- name: Upload Test Reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-reports
|
||||
name: test-reports-java${{ matrix.java }}
|
||||
path: build/reports/tests/
|
||||
|
||||
- name: Report Build Status
|
||||
if: failure()
|
||||
run: |
|
||||
echo "### ❌ Build or Test Failed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### ❌ Build or Test Failed for Java ${{ matrix.java }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Please check the runner logs above for details." >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Reference in New Issue
Block a user