Skip to content

Commit db6b8a1

Browse files
committed
ci: add workflow for publishing benchmarks results
1 parent 4fe0b49 commit db6b8a1

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
concurrency:
2+
group: "${{ github.workflow }}-${{ github.ref }}-benchmark-jvm"
3+
cancel-in-progress: true
4+
5+
on:
6+
workflow_call:
7+
workflow_dispatch:
8+
9+
env:
10+
RELEASE: 1
11+
12+
#name: benchmarks (new)
13+
#on:
14+
# push:
15+
# branches:
16+
# - main
17+
# pull_request:
18+
19+
permissions:
20+
# deployments permission to deploy GitHub pages website
21+
deployments: write
22+
# contents permission to update benchmark contents in gh-pages branch
23+
contents: write
24+
25+
jobs:
26+
benchmark:
27+
name: Performance regression check
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v6
31+
- name: set up jdk 17
32+
uses: actions/setup-java@v5
33+
with:
34+
java-version: "17"
35+
distribution: "adopt"
36+
- name: gradle setup
37+
uses: gradle/actions/setup-gradle@v5
38+
- name: validate gradle wrapper
39+
uses: gradle/actions/wrapper-validation@v5
40+
41+
- name: download linux library
42+
uses: ./.github/actions/make/jvm
43+
with:
44+
gh-token: ${{ secrets.GITHUB_TOKEN }}
45+
artifact-generation: ${{ vars.ARTIFACT_GENERATION }}
46+
47+
# The specific jvm action uses `uname -s` to determine which `jvm` make rule to call.
48+
# Because this workflow runs on ubuntu, we're using the generic action
49+
- name: download aarch64 apple darwin artifact
50+
uses: ./.github/actions/make
51+
with:
52+
key: jvm-darwin
53+
make-rule: jvm-darwin
54+
target-path: target/aarch64-apple-darwin/release/libcore_crypto_ffi.dylib
55+
gh-token: ${{ secrets.GITHUB_TOKEN }}
56+
artifact-generation: ${{ vars.ARTIFACT_GENERATION }}
57+
58+
- name: download kotlin bindings
59+
uses: ./.github/actions/make/bindings-kotlin-jvm
60+
with:
61+
gh-token: ${{ secrets.GITHUB_TOKEN }}
62+
artifact-generation: ${{ vars.ARTIFACT_GENERATION }}
63+
64+
# Run benchmark with `go test -bench` and stores the output to a file
65+
- name: Run benchmark
66+
run: make jvm-bench
67+
# Download previous benchmark result from cache (if exists)
68+
- name: Download previous benchmark data
69+
uses: actions/cache@v4
70+
with:
71+
path: ./cache
72+
key: ${{ runner.os }}-benchmark
73+
# Run `github-action-benchmark` action
74+
- name: Store benchmark result
75+
uses: benchmark-action/github-action-benchmark@v1
76+
with:
77+
# What benchmark tool the output.txt came from
78+
tool: 'jmh'
79+
# Where the output from the benchmark tool is stored
80+
output-file-path: crypto-ffi/bindings/jvm/build/reports/jmh/results.json
81+
# Where the previous data file is stored
82+
external-data-json-path: ./cache/benchmark-data.json
83+
# Workflow will fail when an alert happens
84+
fail-on-alert: true
85+
# Access token to deploy GitHub Pages branch
86+
github-token: ${{ secrets.GITHUB_TOKEN }}
87+
# Push and deploy GitHub pages branch automatically
88+
auto-push: true
89+
# Upload the updated cache file for the next job by actions/cache

.github/workflows/benchmarks_new.yml

Whitespace-only changes.

.github/workflows/pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ jobs:
114114
- build-jvm-darwin
115115
uses: ./.github/workflows/test-jvm.yml
116116

117+
benchmark-jvm:
118+
needs:
119+
- bindings-jvm
120+
- build-jvm-linux
121+
- build-jvm-darwin
122+
uses: ./.github/workflows/benchmark-jvm.yml
123+
117124
docs-jvm:
118125
needs:
119126
- bindings-jvm

0 commit comments

Comments
 (0)