From 180ee7cc52c8fa6fafd3edb6f3a114da59121de3 Mon Sep 17 00:00:00 2001 From: Bertrand Martin Date: Thu, 14 May 2026 00:47:27 +0200 Subject: [PATCH 1/3] fix(ci): resolve benchmark refs correctly in benchmarks workflow --- .github/workflows/benchmarks.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 01d114cb..b6995dc5 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -100,8 +100,12 @@ jobs: if commit="$(git rev-parse --verify --quiet -- "${ref}^{commit}")"; then git checkout --detach "${commit}" else - git fetch origin -- "${ref}" + git fetch origin "${ref}" commit="$(git rev-parse --verify --quiet -- "FETCH_HEAD^{commit}")" + if [ -z "${commit}" ]; then + echo "Unable to resolve benchmark ref '${ref}' to a commit." >&2 + exit 1 + fi git checkout --detach "${commit}" fi From 0a0d0cccb5ecec9d5f67fdf1486037bcf407510c Mon Sep 17 00:00:00 2001 From: Bertrand Martin Date: Thu, 14 May 2026 22:18:46 +0200 Subject: [PATCH 2/3] Simplify benchmark checkout and default to all JMH tests --- .github/workflows/benchmarks.yml | 34 +++++++++++--------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index b6995dc5..6f4a2cfd 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -15,9 +15,9 @@ on: required: false default: "" pattern: - description: "JMH benchmark pattern" + description: "JMH benchmark pattern; defaults to all benchmarks" required: false - default: "JRTCompare2Benchmark" + default: ".*" jmhArgs: description: "Extra JMH arguments; when provided, CLI options override benchmark annotations" required: false @@ -33,7 +33,7 @@ concurrency: cancel-in-progress: false env: - DEFAULT_JMH_PATTERN: JRTCompare2Benchmark + DEFAULT_JMH_PATTERN: .* BENCHMARK_SITE_URL: https://jawk.io/ jobs: @@ -46,7 +46,15 @@ jobs: publish: ${{ steps.select.outputs.publish }} steps: - - name: Checkout repository + - name: Checkout selected benchmark ref + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ inputs.ref || 'main' }} + + - name: Checkout triggering ref + if: github.event_name != 'workflow_dispatch' uses: actions/checkout@v6 with: fetch-depth: 0 @@ -91,24 +99,6 @@ jobs: if [ -z "${pattern}" ]; then pattern="${DEFAULT_JMH_PATTERN}" fi - if [[ "${ref}" == -* ]]; then - echo "Benchmark ref must not start with '-'." >&2 - exit 1 - fi - - git fetch --tags --force origin - if commit="$(git rev-parse --verify --quiet -- "${ref}^{commit}")"; then - git checkout --detach "${commit}" - else - git fetch origin "${ref}" - commit="$(git rev-parse --verify --quiet -- "FETCH_HEAD^{commit}")" - if [ -z "${commit}" ]; then - echo "Unable to resolve benchmark ref '${ref}' to a commit." >&2 - exit 1 - fi - git checkout --detach "${commit}" - fi - safe_version="$(printf '%s' "${version}" | tr '/\\ ' '---' | tr -cd 'A-Za-z0-9._-')" if [ -z "${safe_version}" ]; then safe_version="$(git rev-parse --short HEAD)" From 317fd7f8309e692493d24ffae53dffb88853aa52 Mon Sep 17 00:00:00 2001 From: Bertrand Martin Date: Thu, 14 May 2026 22:38:39 +0200 Subject: [PATCH 3/3] Simplify benchmark workflow checkout and defaults --- .github/workflows/benchmarks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 6f4a2cfd..de4709e9 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -7,9 +7,9 @@ on: workflow_dispatch: inputs: ref: - description: "Git ref to benchmark" + description: "Git ref to benchmark; defaults to the version input, then the selected workflow ref" required: false - default: "main" + default: "" version: description: "Version label to publish; defaults to the selected ref" required: false @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - ref: ${{ inputs.ref || 'main' }} + ref: ${{ inputs.ref || inputs.version || github.ref }} - name: Checkout triggering ref if: github.event_name != 'workflow_dispatch' @@ -83,7 +83,7 @@ jobs: jmh_args="" publish="true" else - ref="${INPUT_REF}" + ref="${INPUT_REF:-${INPUT_VERSION:-${GITHUB_REF_NAME}}}" version="${INPUT_VERSION}" pattern="${INPUT_PATTERN}" jmh_args="${INPUT_JMH_ARGS}"