64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Build and Test j3270
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master", "main", "develop" ]
|
|
pull_request:
|
|
branches: [ "master", "main" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build JAR & Run Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Java JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
|
|
- name: Make scripts executable
|
|
run: |
|
|
chmod +x ./build_all.sh ./gradlew ./run.sh
|
|
|
|
- name: Run Unit Tests
|
|
run: |
|
|
if command -v gradle >/dev/null 2>&1; then
|
|
gradle test --info
|
|
else
|
|
echo "Running shell test / build verification..."
|
|
./build_all.sh
|
|
fi
|
|
|
|
- name: Build Standalone JAR
|
|
run: |
|
|
./build_all.sh
|
|
|
|
- name: Upload j3270 Executable JAR Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: j3270-executable-jar
|
|
path: build/j3270.jar
|
|
if-no-files-found: error
|
|
|
|
- name: Upload Test Reports
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-reports
|
|
path: |
|
|
lib3270j/build/reports/tests/
|
|
j3270/build/reports/tests/
|
|
if-no-files-found: ignore
|
|
|
|
- name: Report Build Status
|
|
if: failure()
|
|
run: |
|
|
echo "### ❌ Build or Test Failed" >> $GITHUB_STEP_SUMMARY
|
|
echo "Please check the runner logs and test reports above for details." >> $GITHUB_STEP_SUMMARY
|