chore: Bump version to 0.18.0-SNAPSHOT #395
Workflow file for this run
This file contains hidden or 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 and Test (Gradle) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| java_versions: | |
| description: "Java versions to run (array, e.g. [11,17,21])" | |
| required: false | |
| default: "[21]" | |
| os: | |
| description: "Select operating system" | |
| required: false | |
| type: choice | |
| options: | |
| - ubuntu-latest | |
| - ubuntu-24.04 | |
| - ubuntu-22.04 | |
| - ubuntu-24.04-arm | |
| - ubuntu-22.04-arm | |
| - macos-latest | |
| - macos-26 | |
| - macos-15-intel | |
| - macos-15 | |
| - macos-13 | |
| - macos-14 | |
| default: ubuntu-latest | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: ${{ inputs.os && fromJSON(format('["{0}"]', inputs.os)) || fromJSON('["ubuntu-latest","macos-latest"]') }} | |
| java: ${{ fromJSON(inputs.java_versions || '["21"]') }} | |
| runs-on: ${{ matrix.os }} | |
| name: Build (Java ${{ matrix.java }}) ${{ matrix.os }} | |
| env: | |
| GRADLE_OPTS_EXTRA: "-Dorg.gradle.parallel=false -Dorg.gradle.caching=true -Dorg.gradle.daemon=false" | |
| BUILDSCAN_PUBLISH: "true" | |
| BUILDSCAN_AUTOACCEPTTERMS: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| .gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml', '**/build.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Download dependencies | |
| run: | | |
| echo "📥 Downloading Gradle dependencies..." | |
| ./gradlew dependencies || { | |
| echo "❌ Failed to download dependencies" | |
| exit 1 | |
| } | |
| echo "✅ Dependencies downloaded successfully" | |
| shell: bash | |
| - name: Build project (without tests) | |
| run: | | |
| echo "🔨 Building project..." | |
| ./gradlew clean || { echo "❌ Clean failed"; exit 1; } | |
| ./gradlew assemble || { echo "❌ Assemble failed"; exit 1; } | |
| echo "✅ Project built successfully" | |
| shell: bash | |
| - name: Collect build artifacts | |
| run: | | |
| echo "📦 Collecting artifacts..." | |
| rm -rf build/package | |
| mkdir -p build/package/{primary,sources,javadoc,others} | |
| # Primary jars (exclude sources/javadoc) | |
| find . -type f -path "*/build/libs/*.jar" \ | |
| ! -name "*-sources.jar" ! -name "*-javadoc.jar" \ | |
| -exec cp {} build/package/primary/ \; || true | |
| # Sources & Javadoc jars (if any) | |
| find . -type f -path "*/build/libs/*-sources.jar" -exec cp {} build/package/sources/ \; || true | |
| find . -type f -path "*/build/libs/*-javadoc.jar" -exec cp {} build/package/javadoc/ \; || true | |
| # (Optional) POMs or other publish files | |
| find . -type f -path "*/build/publications/*/*.pom" -exec cp {} build/package/others/ \; || true | |
| echo "✅ Collected:" | |
| find build/package -type f -maxdepth 2 -print | |
| shell: bash | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: build/ | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ${{ inputs.os && fromJSON(format('["{0}"]', inputs.os)) || fromJSON('["ubuntu-latest","macos-latest"]') }} | |
| java: ${{ fromJSON(inputs.java_versions || '["21"]') }} | |
| name: Test (Java ${{ matrix.java }}) ${{ matrix.os }} | |
| needs: build | |
| env: | |
| GRADLE_OPTS_EXTRA: "-Dorg.gradle.parallel=false -Dorg.gradle.caching=true -Dorg.gradle.daemon=false" | |
| BUILDSCAN_PUBLISH: "true" | |
| BUILDSCAN_AUTOACCEPTTERMS: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: build-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: build/ | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| .gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml', '**/build.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Run tests | |
| run: | | |
| echo "🧪 Running tests..." | |
| ./gradlew test --continue || { | |
| echo "⚠️ Some tests failed, but continuing" | |
| echo "Test failures are not blocking the pipeline" | |
| } | |
| echo "✅ Test execution completed" | |
| shell: bash | |
| - name: Generate coverage and test reports | |
| if: always() | |
| run: | | |
| echo "📊 Generating aggregated coverage and test reports..." | |
| ./gradlew testAndCoverage --no-configuration-cache || { | |
| echo "❌ Failed to generate reports" | |
| exit 1 | |
| } | |
| echo "✅ Reports generated successfully" | |
| shell: bash | |
| - name: Upload JUnit test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-results-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: '**/build/test-results/test/*.xml' | |
| - name: Upload JaCoCo coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: build/reports/jacoco | |
| - name: Upload all reports (for debugging) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: all-reports-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: build/reports | |
| - name: Setup Python | |
| if: always() | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python dependencies | |
| if: always() | |
| run: pip install -r .github/scripts/requirements.txt | |
| - name: Running Python Script Tests | |
| if: always() | |
| run: | | |
| cd .github/scripts/tests | |
| python3 -m unittest discover | |
| shell: bash | |
| detekt: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ${{ inputs.os && fromJSON(format('["{0}"]', inputs.os)) || fromJSON('["ubuntu-latest","macos-latest"]') }} | |
| java: ${{ fromJSON(inputs.java_versions || '["21"]') }} | |
| name: detekt (Java ${{ matrix.java }}) ${{ matrix.os }} | |
| needs: build | |
| env: | |
| GRADLE_OPTS_EXTRA: "-Dorg.gradle.parallel=false -Dorg.gradle.caching=true -Dorg.gradle.daemon=false" | |
| BUILDSCAN_PUBLISH: "true" | |
| BUILDSCAN_AUTOACCEPTTERMS: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| .gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml', '**/build.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Run Detekt Static Analysis | |
| run: | | |
| echo "🧹 Running Detekt static analysis..." | |
| ./gradlew detekt --no-daemon --max-workers=1 || { | |
| echo "❌ Detekt found code style violations" | |
| exit 1 | |
| } | |
| echo "✅ Detekt analysis passed" | |
| shell: bash | |
| - name: Upload Detekt reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: detekt-reports-java-${{ matrix.java }}-${{ matrix.os }} | |
| path: '**/build/reports/detekt/**/*' | |
| ktlint: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ${{ inputs.os && fromJSON(format('["{0}"]', inputs.os)) || fromJSON('["ubuntu-latest","macos-latest"]') }} | |
| java: ${{ fromJSON(inputs.java_versions || '["21"]') }} | |
| name: ktlint (Java ${{ matrix.java }}) ${{ matrix.os }} | |
| needs: build | |
| env: | |
| GRADLE_OPTS_EXTRA: "-Dorg.gradle.parallel=false -Dorg.gradle.caching=true -Dorg.gradle.daemon=false" | |
| BUILDSCAN_PUBLISH: "true" | |
| BUILDSCAN_AUTOACCEPTTERMS: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| .gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml', '**/build.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Run Ktlint Code Formatting Check | |
| run: | | |
| echo "🧹 Running Ktlint code formatting check..." | |
| ./gradlew ktlintCheck --no-daemon --max-workers=1 || { | |
| echo "❌ Ktlint found code formatting violations" | |
| exit 1 | |
| } | |
| echo "✅ Ktlint formatting check passed" | |
| shell: bash | |
| coverage-verification: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ${{ inputs.os && fromJSON(format('["{0}"]', inputs.os)) || fromJSON('["ubuntu-latest","macos-latest"]') }} | |
| java: ${{ fromJSON(inputs.java_versions || '["21"]') }} | |
| name: coverage verification (Java ${{ matrix.java }}) ${{ matrix.os }} | |
| needs: test | |
| if: failure() || success() | |
| env: | |
| GRADLE_OPTS_EXTRA: "-Dorg.gradle.parallel=false -Dorg.gradle.caching=true -Dorg.gradle.daemon=false" | |
| BUILDSCAN_PUBLISH: "true" | |
| BUILDSCAN_AUTOACCEPTTERMS: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| .gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml', '**/build.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Verify coverage thresholds | |
| run: | | |
| echo "🎯 Verifying coverage thresholds..." | |
| ./gradlew testCodeCoverageVerification --no-configuration-cache -x testCodeCoverageReport || { | |
| echo "❌ Coverage thresholds not met" | |
| echo "Please check the coverage report and add more tests" | |
| exit 1 | |
| } | |
| echo "✅ Coverage thresholds met successfully" | |
| shell: bash | |
| slack-alerts: | |
| runs-on: ubuntu-latest | |
| needs: [build, test, detekt, ktlint, coverage-verification] | |
| if: always() | |
| steps: | |
| - name: Detect failed job and step | |
| id: check_failures | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| run_id=${{ github.run_id }} | |
| failed_jobs=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/jobs \ | |
| --jq '[.jobs[] | select(.conclusion=="failure") | .name] | join(", ")') | |
| failed_steps=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/jobs \ | |
| --jq '[.jobs[] | select(.conclusion=="failure") | .steps[] | select(.conclusion=="failure") | .name] | join(", ")') | |
| alert_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| echo "failed_jobs=$failed_jobs" >> "$GITHUB_OUTPUT" | |
| echo "failed_steps=$failed_steps" >> "$GITHUB_OUTPUT" | |
| echo "alert_time=$alert_time" >> "$GITHUB_OUTPUT" | |
| - name: Post formatted failure alert to Slack | |
| if: ${{ steps.check_failures.outputs.failed_jobs != '' }} | |
| uses: slackapi/[email protected] | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ vars.SLACK_CHANNEL_ID }} | |
| text: | | |
| :x: *GitHub Actions Pipeline Failure* | |
| > *${{ github.workflow }}* (#${{ github.run_number }}) in repository: `${{ github.event.repository.name }}` | |
| ``` | |
| ❗ Description : One or more jobs failed | |
| 🧩 Failed Jobs : ${{ steps.check_failures.outputs.failed_jobs }} | |
| 🧱 Failed Step : ${{ steps.check_failures.outputs.failed_steps }} | |
| 🌿 Branch : ${{ github.ref_name }} | |
| 🧑💻 Actor : ${{ github.actor }} | |
| 🔢 Commit SHA : ${{ github.sha }} | |
| 🕒 Time : ${{ steps.check_failures.outputs.alert_time }} | |
| ``` | |
| *Links:* | |
| • 🔗 [Repository](${{ github.server_url }}/${{ github.repository }}) | |
| • 🚀 [Workflow Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |