-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hoist benchmarking into reusable job
Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
227fd53
commit cdcb373
Showing
3 changed files
with
96 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: bench-core-reusable | ||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
type: string | ||
description: Name of the runner to use | ||
name: | ||
type: string | ||
description: Name for the benchmarking run | ||
required: true | ||
perf: | ||
description: Method of obtaining PMU metrics | ||
required: true | ||
default: 'PERF' | ||
type: choice | ||
options: | ||
- NO | ||
- PERF | ||
- PMU | ||
- M1 | ||
cflags: | ||
type: string | ||
description: CFLAGS to pass to compilation | ||
default: '' | ||
archflags: | ||
type: string | ||
description: ARCHFLAGS to pass to compilation | ||
default: '' | ||
bench_extra_args: | ||
type: string | ||
description: Further arguments to be appended to command line for `bench` script | ||
default: '' | ||
store_results: | ||
type: string | ||
description: Whether to push results to GH pages | ||
default: 'false' | ||
jobs: | ||
bench: | ||
name: Bench ${{ inputs.name }} | ||
runs-on: ${{ inputs.runner }} | ||
defaults: | ||
run: | ||
shell: nix develop .#ci -c bash -e {0} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup nix | ||
uses: ./.github/actions/setup-nix | ||
with: | ||
devShell: ci | ||
script: | | ||
ARCH=$(uname -m) | ||
cat >> $GITHUB_STEP_SUMMARY <<-EOF | ||
## Setup | ||
Architecture: $ARCH | ||
- $(uname -a) | ||
- $(nix --version) | ||
- $(astyle --version) | ||
- $(${{ matrix.target.cross_prefix }}gcc --version | grep -m1 "") | ||
- $(bash --version | grep -m1 "") | ||
## CPU Info | ||
$(cat /proc/cpuinfo) | ||
EOF | ||
- name: Run benchmark | ||
uses: ./.github/actions/bench | ||
with: | ||
name: ${{ inputs.name }} | ||
cflags: ${{ inputs.cflags }} | ||
archflags: ${{ inputs.archflags }} | ||
perf: ${{ inputs.perf }} | ||
store_results: ${{ inputs.store_results }} | ||
bench_extra_args: ${{ inputs.bench_extra_args }} | ||
gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters