From 7bc92c60755f51de00a950edfead4760b2cd8e3a Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Thu, 30 Apr 2026 14:39:31 +0200 Subject: [PATCH] workflow: update benchmarks notebook generation Signed-off-by: Stephan Renatus --- .github/workflows/benchmarks.yaml | 32 +++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/benchmarks.yaml b/.github/workflows/benchmarks.yaml index 40eb3c36c4..8678ee2254 100644 --- a/.github/workflows/benchmarks.yaml +++ b/.github/workflows/benchmarks.yaml @@ -55,7 +55,7 @@ jobs: --input changed_files.json \ --format pretty \ 'data.policy["pr-check"]' > opa_result.json - + go_result=$(jq -r '.changes.go // false' opa_result.json) echo "go=${go_result}" >> $GITHUB_OUTPUT @@ -88,21 +88,33 @@ jobs: with: ref: benchmarks persist-credentials: true - - name: Install Node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Setup Java + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - node-version: 25 + distribution: 'temurin' + java-version: '21' + - name: Setup Clojure + uses: DeLaGuardo/setup-clojure@02f5a82b79a547523e664fe8a7a32ea14884d7b2 # 13.6.0 + with: + cli: latest + - name: Cache Clojure dependencies + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: | + ~/.m2/repository + ~/.gitlibs + key: clj-${{ hashFiles('clay/deps.edn') }} + restore-keys: clj- + - name: Clean previous output + run: rm -rf docs/*.html - name: update notebook run: | - npm ci - cp ../benchmarks.json . # nodejs data loader can't access ../ - npm run docs:build - rm benchmarks.json - working-directory: src/ + clojure -M -m opa-bench.generate + working-directory: clay/ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: commit if changed - working-directory: benchmarks/ # output dir of the docs:build command + working-directory: docs/ run: | if ! git diff-index --quiet HEAD -- .; then git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"