From 2a450ca1dac4afb30975c0c3e854bae283b3ca70 Mon Sep 17 00:00:00 2001
From: Valera V Harseko <vharseko@3a-systems.ru>
Date: Tue, 23 Jun 2026 09:39:07 +0000
Subject: [PATCH] build.yml: benchmark the built image against the released one

---
 .github/workflows/build.yml |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 58927fe..2a88ece 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -308,6 +308,9 @@
         ports:
           - 5000:5000
     steps:
+      - uses: actions/checkout@v6
+        with:
+          sparse-checkout: .github/benchmark
       - name: Download artifacts
         uses: actions/download-artifact@v8
         with:
@@ -369,6 +372,17 @@
           timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test_custom | grep -q \"healthy\"; do sleep 10; done'
           docker exec test_custom 'sh' '-c' '/opt/opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "cn=Directory Manager" --bindPassword custom_password --useSsl --trustAll --baseDN "dc=example,dc=com" --searchScope base "(objectClass=*)" 1.1'
           docker kill test_custom
+      - name: Cache JMeter
+        uses: actions/cache@v5
+        with:
+          path: ~/jmeter
+          key: jmeter-5.6.3
+      - name: Benchmark Build vs Release
+        shell: bash
+        run: |
+          THREADS=200 DURATION=150 bash .github/benchmark/compare-opendj.sh \
+            "Build"   localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }} \
+            "Release" openidentityplatform/opendj:latest
 
   build-docker-alpine:
     needs: build-maven
@@ -379,6 +393,9 @@
         ports:
           - 5000:5000
     steps:
+      - uses: actions/checkout@v6
+        with:
+          sparse-checkout: .github/benchmark
       - name: Download artifacts
         uses: actions/download-artifact@v8
         with:
@@ -441,3 +458,14 @@
           timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test_custom | grep -q \"healthy\"; do sleep 10; done'
           docker exec test_custom 'sh' '-c' '/opt/opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "cn=Directory Manager" --bindPassword custom_password --useSsl --trustAll --baseDN "dc=example,dc=com" --searchScope base "(objectClass=*)" 1.1'
           docker kill test_custom
+      - name: Cache JMeter
+        uses: actions/cache@v5
+        with:
+          path: ~/jmeter
+          key: jmeter-5.6.3
+      - name: Benchmark Build-alpine vs Release-alpine
+        shell: bash
+        run: |
+          THREADS=200 DURATION=150 bash .github/benchmark/compare-opendj.sh \
+            "Build-alpine"   localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}-alpine \
+            "Release-alpine" openidentityplatform/opendj:alpine

--
Gitblit v1.10.0