Skip to content

Benchmark

Benchmark #3225

Workflow file for this run

name: Benchmark
on:
workflow_dispatch:
inputs:
exclude-slow-benchmarks:
description: 'Exclude slow benchmarks'
required: true
type: boolean
default: false
exclude-unstable-benchmarks:
description: 'Exclude unstable benchmarks'
required: true
type: boolean
default: false
exclude-release-only-benchmarks:
description: 'Exclude release benchmarks'
required: true
type: boolean
default: false
jobs:
get-exclude-dirs:
name: Get exclude directories
runs-on: ubuntu-latest
outputs:
exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }}
steps:
- uses: actions/checkout@v4
- id: get-exclude-dirs
uses: ./.github/actions/get_exclude_dirs
with:
exclude-slow: ${{ github.event.inputs.exclude-slow-benchmarks }}
exclude-unstable: ${{ github.event.inputs.exclude-unstable-benchmarks }}
exclude-release-only: ${{ github.event.inputs.exclude-release-only-benchmarks }}
create-branch-prefix:
uses: ./.github/workflows/create_branch_prefix.yml
with:
prefix: 'benchmark'
version: VERSION=$(jq -r '.version' package.json)
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
run-benchmarks:
name: ${{ matrix.benchmark_group.name }}
needs:
- get-exclude-dirs
- create-branch-prefix
strategy:
fail-fast: false
matrix:
benchmark_group:
- { name: 'Examples', directories: './examples' }
- {
name: 'E2E Class',
directories: './tests/end_to_end/candid_rpc/class_syntax'
}
- {
name: 'E2E Functional',
directories: './tests/end_to_end/candid_rpc/functional_syntax'
}
- {
name: 'E2E HTTP Server',
directories: './tests/end_to_end/http_server'
}
- {
name: 'Property Class',
directories: './tests/property/candid_rpc/class_api'
}
uses: ./.github/workflows/benchmark_parallel.yml
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
directories: ${{ matrix.benchmark_group.directories }}
exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }}
squash-branches:
needs: [run-benchmarks, create-branch-prefix]
uses: ./.github/workflows/squash_branches.yml
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
commit-message: 'run benchmarks'
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
create-pr:
needs: [squash-branches, create-branch-prefix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
run: |
gh pr create \
--base main \
--head ${{ needs.create-branch-prefix.outputs.base-branch }} \
--title "Benchmark Results for ${{ needs.create-branch-prefix.outputs.base-branch }}" \
--body "Automated PR for benchmark results"