JMH Benchmarks #1
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: JMH Benchmarks | |
| # Strict JMH layer (Track C / B6). Deliberately decoupled from the main CI | |
| # pipeline: forked JMH runs take minutes and must not gate PRs, so this runs | |
| # only on demand and on a weekly cadence, and uploads the JSON report as an | |
| # artifact. The manual smoke/diff harness keeps its own jobs in ci.yml. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| args: | |
| description: 'Extra JMH CLI args (e.g. "CanonicalRender -f 2 -wi 5 -i 10")' | |
| required: false | |
| default: '' | |
| schedule: | |
| # Weekly, Monday 06:00 UTC (one hour after the ci.yml weekly job). | |
| # NOTE: GitHub runs scheduled workflows only from the default branch (main), | |
| # so this cron stays dormant while the file lives on develop and starts firing | |
| # once it reaches main at release. workflow_dispatch works on any branch now. | |
| - cron: '0 6 * * 1' | |
| permissions: | |
| contents: read | |
| jobs: | |
| jmh: | |
| name: Strict JMH benchmarks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| env: | |
| JAVA_TOOL_OPTIONS: -Djava.awt.headless=true | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Temurin JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: maven | |
| - name: Install root artifact (graph-compose + test-jar) | |
| run: ./mvnw -B -ntp -DskipTests install -pl . | |
| - name: Build the JMH runner jar | |
| run: ./mvnw -B -ntp -f benchmarks/pom.xml clean package -DskipTests | |
| - name: Run JMH benchmarks (forked, JSON report) | |
| env: | |
| JMH_ARGS: ${{ github.event.inputs.args }} | |
| run: | | |
| java -jar benchmarks/target/benchmarks.jar \ | |
| -rf json -rff benchmarks/target/jmh-result.json \ | |
| $JMH_ARGS | |
| - name: Upload JMH results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: jmh-results-${{ github.run_id }} | |
| path: benchmarks/target/jmh-result.json | |
| if-no-files-found: warn |