blob: e76436981c328cab656e480e43d3a8b5eddf0d85 [file]
#
# Copyright (c) 2026 Eclipse Foundation and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0,
# or the Eclipse Distribution License v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
name: Performance
on:
schedule:
# Runs every Thursday at 4:35 AM UTC (avoid peak hours for better performance results)
- cron: '35 4 * * 4'
workflow_dispatch:
jobs:
performance:
name: Run JMH performance tests
runs-on: ubuntu-latest
steps:
- name: Checkout for performance
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Set up compile JDK
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with: #Compile java needs to be the highest to ensure proper compilation of the multi-release jar
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Compile API
run: |
mvn -U -C clean install --file api/pom.xml
- name: Run JMH performance tests
run: |
cd perf
mvn -U -B clean package
java -jar target/jsonp-jmh.jar -rf json -rff jmh-result.json
- name: Persist JMH results
uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1
with:
name: Java JMH Benchmark
tool: 'jmh'
output-file-path: perf/jmh-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable deployment to GitHub Pages for continuous line graphs
auto-push: true
comment-on-alert: true # Creates a comment if performance degrades
fail-on-alert: true # Fails the workflow run on regression
alert-threshold: '200%' # Triggers an alert if execution time doubles