Skip to content

Update CLAUDE.md to document kotlin-logging migration #111

Update CLAUDE.md to document kotlin-logging migration

Update CLAUDE.md to document kotlin-logging migration #111

Workflow file for this run

name: Gradle Build with Kotlin 2.0 and Java 21
on:
push:
branches: [ main, develop, 'feature/**', 'fix/**', 'copilot/**' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Allow manual trigger
permissions:
contents: read
checks: write # For test reporting
packages: read # For GitHub Packages (jDisco dependency)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
JAVA_VERSION: '21'
GRADLE_OPTS: '-Xmx512m -XX:MaxMetaspaceSize=512m'
KOTLIN_COMPILER_PARALLELISM: '4' # Enable parallel Kotlin compilation for faster builds
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 25 # Increased from 15 to 25 minutes for Kotlin compilation overhead
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
- name: Cache jDisco from GitHub Packages
id: cache-jdisco
uses: actions/cache@v4
with:
path: ~/.m2/repository/dk/ruc/keld/jdisco
key: jdisco-1.2.0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"
- name: Make Gradle wrapper executable
run: chmod +x gradlew
- name: Compile Kotlin and Java sources
timeout-minutes: 15
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean compileKotlin compileJava compileTestKotlin compileTestJava --no-daemon --warning-mode=all --stacktrace
- name: Run unit tests
timeout-minutes: 10
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew test --no-daemon --warning-mode=all --stacktrace
- name: Run integration tests
timeout-minutes: 10
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew integrationTest --no-daemon --warning-mode=all --stacktrace
- name: Create JAR artifacts (shadowJar)
timeout-minutes: 10
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew shadowJar --no-daemon --stacktrace
- name: Upload compiled JAR artifact
uses: actions/upload-artifact@v4
if: success()
with:
name: interlockSim-jar-${{ github.sha }}
path: build/libs/interlockSim.jar
retention-days: 90
if-no-files-found: error
compression-level: 9
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.sha }}
path: build/test-results/
retention-days: 30
- name: Generate test report summary
if: always()
run: |
if [ -f build/test-results/test/TEST-*.xml ]; then
echo "## Test Execution Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Count total tests
TOTAL_TESTS=$(find build/test-results -name "TEST-*.xml" -exec grep -h 'tests="' {} \; | awk -F'tests="' '{sum+=$2; gsub(/".*/, "", sum)}' | awk '{s+=$1} END {print s}')
echo "**Total Unit Tests**: $TOTAL_TESTS" >> $GITHUB_STEP_SUMMARY
# Count failures
FAILURES=$(find build/test-results -name "TEST-*.xml" -exec grep -h 'failures="' {} \; | awk -F'failures="' '{sum+=$2; gsub(/".*/, "", sum)}' | awk '{s+=$1} END {print s}')
echo "**Failures**: $FAILURES" >> $GITHUB_STEP_SUMMARY
echo "**Status**: ✓ All tests passed" >> $GITHUB_STEP_SUMMARY
fi
- name: Run smoke test (shunting loop simulation)
if: success()
timeout-minutes: 8
run: |
echo "Starting smoke test (shunting loop, 300 simulated seconds)..."
echo "Timeout: 8 minutes. Under normal CI conditions: ~4-5 minutes."
if java -Dlogback.configurationFile=.github/workflows/logback-ci.xml -jar -ea build/libs/interlockSim.jar example shuntingLoop 300; then
echo "✓ Smoke test completed successfully"
exit 0
else
EXIT_CODE=$?
echo "✗ Smoke test failed with exit code: $EXIT_CODE"
exit $EXIT_CODE
fi