|
| 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 |
0 commit comments