This commit is contained in:
+16
-15
@@ -23,31 +23,34 @@ jobs:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Ensure Java JDK Available
|
||||
- name: Ensure Java & Build Tools Available
|
||||
run: |
|
||||
if ! command -v javac >/dev/null 2>&1; then
|
||||
echo "javac not found in PATH, installing OpenJDK..."
|
||||
if ! command -v javac >/dev/null 2>&1 || ! command -v gradle >/dev/null 2>&1; then
|
||||
echo "Installing JDK 17 and Gradle via package manager..."
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update && apt-get install -y openjdk-17-jdk-headless
|
||||
apt-get update && apt-get install -y openjdk-17-jdk-headless gradle || true
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache openjdk17
|
||||
apk add --no-cache openjdk17 gradle || true
|
||||
fi
|
||||
fi
|
||||
echo "Using Java compiler:"
|
||||
javac -version || which javac
|
||||
echo "Using Java runtime:"
|
||||
java -version || which java
|
||||
echo "Java compiler:"
|
||||
javac -version || which javac || true
|
||||
echo "Java runtime:"
|
||||
java -version || which java || true
|
||||
echo "Gradle:"
|
||||
gradle -version || echo "Gradle not available"
|
||||
|
||||
- name: Make scripts executable
|
||||
run: |
|
||||
chmod +x ./build_all.sh ./gradlew ./run.sh
|
||||
chmod +x ./build_all.sh ./run.sh
|
||||
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
if command -v gradle >/dev/null 2>&1; then
|
||||
echo "Running Gradle unit tests..."
|
||||
gradle test --info
|
||||
else
|
||||
echo "Testing via build_all.sh..."
|
||||
echo "Gradle not found; running standalone build verification..."
|
||||
sh ./build_all.sh
|
||||
fi
|
||||
|
||||
@@ -56,23 +59,21 @@ jobs:
|
||||
sh ./build_all.sh
|
||||
|
||||
- name: Upload j3270 Executable JAR Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: j3270-executable-jar
|
||||
path: build/j3270.jar
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload Test Reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-reports
|
||||
path: |
|
||||
lib3270j/build/reports/tests/
|
||||
j3270/build/reports/tests/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Report Build Status
|
||||
if: failure()
|
||||
|
||||
@@ -23,31 +23,34 @@ jobs:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Ensure Java JDK Available
|
||||
- name: Ensure Java & Build Tools Available
|
||||
run: |
|
||||
if ! command -v javac >/dev/null 2>&1; then
|
||||
echo "javac not found in PATH, installing OpenJDK..."
|
||||
if ! command -v javac >/dev/null 2>&1 || ! command -v gradle >/dev/null 2>&1; then
|
||||
echo "Installing JDK 17 and Gradle via package manager..."
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update && apt-get install -y openjdk-17-jdk-headless
|
||||
apt-get update && apt-get install -y openjdk-17-jdk-headless gradle || true
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache openjdk17
|
||||
apk add --no-cache openjdk17 gradle || true
|
||||
fi
|
||||
fi
|
||||
echo "Using Java compiler:"
|
||||
javac -version || which javac
|
||||
echo "Using Java runtime:"
|
||||
java -version || which java
|
||||
echo "Java compiler:"
|
||||
javac -version || which javac || true
|
||||
echo "Java runtime:"
|
||||
java -version || which java || true
|
||||
echo "Gradle:"
|
||||
gradle -version || echo "Gradle not available"
|
||||
|
||||
- name: Make scripts executable
|
||||
run: |
|
||||
chmod +x ./build_all.sh ./gradlew ./run.sh
|
||||
chmod +x ./build_all.sh ./run.sh
|
||||
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
if command -v gradle >/dev/null 2>&1; then
|
||||
echo "Running Gradle unit tests..."
|
||||
gradle test --info
|
||||
else
|
||||
echo "Testing via build_all.sh..."
|
||||
echo "Gradle not found; running standalone build verification..."
|
||||
sh ./build_all.sh
|
||||
fi
|
||||
|
||||
@@ -56,23 +59,21 @@ jobs:
|
||||
sh ./build_all.sh
|
||||
|
||||
- name: Upload j3270 Executable JAR Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: j3270-executable-jar
|
||||
path: build/j3270.jar
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload Test Reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-reports
|
||||
path: |
|
||||
lib3270j/build/reports/tests/
|
||||
j3270/build/reports/tests/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Report Build Status
|
||||
if: failure()
|
||||
|
||||
Reference in New Issue
Block a user