build(deps): bump org.apache.commons:commons-configuration2 from 2.13.0 to 2.14.0 #346
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: Benchmarks | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| benchmark: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Run benchmarks | |
| run: | | |
| ./mvnw --batch-mode clean test-compile -P benchmark | |
| ./mvnw --batch-mode -q -P benchmark dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=target/benchmark-classpath.txt | |
| CLASSPATH="target/test-classes:target/classes:$(< target/benchmark-classpath.txt)" | |
| java -cp "$CLASSPATH" org.openjdk.jmh.Main -wi 2 -i 3 -f 1 -rf json -rff benchmark-results.json ${JMH_INCLUDE:+-include ${JMH_INCLUDE}} | |
| - name: Process benchmark results | |
| if: always() | |
| run: | | |
| if [ -f benchmark-results.json ]; then | |
| ENTRY_COUNT=$(jq 'length' benchmark-results.json) | |
| if [ "$ENTRY_COUNT" -eq 0 ]; then | |
| echo "::error::benchmark-results.json contained no benchmark entries" | |
| exit 1 | |
| fi | |
| echo "## Benchmark Results" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # Extract and display results with jq | |
| jq -r '.[] | "\(.benchmark): \(.primaryMetric.score) ± \(.primaryMetric.scoreError) \(.primaryMetric.scoreUnit)"' benchmark-results.json >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # Check for performance regressions (fail if any benchmark takes >50ms) | |
| FAILED=0 | |
| while IFS= read -r line; do | |
| SCORE=$(echo "$line" | jq -r '.primaryMetric.score') | |
| BENCHMARK=$(echo "$line" | jq -r '.benchmark') | |
| # Convert to integer for comparison (assuming milliseconds) | |
| SCORE_INT=$(echo "$SCORE" | cut -d. -f1) | |
| if [ "$SCORE_INT" -gt 50 ]; then | |
| echo "❌ Performance regression detected in $BENCHMARK: ${SCORE}ms exceeds 50ms threshold" >> $GITHUB_STEP_SUMMARY | |
| FAILED=1 | |
| fi | |
| done < <(jq -c '.[]' benchmark-results.json) | |
| if [ "$FAILED" -eq 1 ]; then | |
| echo "::error::Performance regression detected - one or more benchmarks exceeded the 50ms threshold" | |
| exit 1 | |
| else | |
| echo "✅ All benchmarks passed performance thresholds" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| else | |
| echo "::error::No benchmark results found" | |
| exit 1 | |
| fi | |
| - name: Upload benchmark results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: benchmark-results | |
| path: benchmark-results.json | |
| retention-days: 30 |