move bench_ec2_all to bench workflow and only store results for pushing to main event #242
Workflow file for this run
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
# SPDX-License-Identifier: Apache-2.0 | |
name: Bench | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
types: [ "labeled" ] | |
jobs: | |
bench: | |
name: ${{ matrix.target.name }} | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
- system: rpi4 | |
name: Arm Cortex-A72 (Raspberry Pi 4) benchmarks | |
bench_pmu: PMU | |
archflags: -mcpu=cortex-a72 -DSYS_AARCH64_SLOW_BARREL_SHIFTER | |
cflags: -DFORCE_AARCH64 | |
bench_extra_args: "" | |
- system: rpi5 | |
name: Arm Cortex-A76 (Raspberry Pi 5) benchmarks | |
bench_pmu: PERF | |
archflags: "-mcpu=cortex-a76 -march=armv8.2-a" | |
cflags: -DFORCE_AARCH64 | |
bench_extra_args: "" | |
- system: a55 | |
name: Arm Cortex-A55 (Snapdragon 888) benchmarks | |
bench_pmu: PERF | |
archflags: "-mcpu=cortex-a55 -march=armv8.2-a" | |
cflags: "-static -DFORCE_AARCH64" | |
bench_extra_args: -w exec-on-a55 | |
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main') | |
runs-on: self-hosted-${{ matrix.target.system }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/bench | |
with: | |
name: ${{ matrix.target.name }} | |
cflags: ${{ matrix.target.cflags }} | |
archflags: ${{ matrix.target.archflags }} | |
perf: ${{ matrix.target.bench_pmu }} | |
store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }} | |
bench_extra_args: ${{ matrix.target.bench_extra_args }} | |
gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} | |
ec2_all: | |
name: ${{ matrix.target.name }} ${{ matrix.opt.name }} | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
strategy: | |
fail-fast: false | |
matrix: | |
opt: | |
- name: opt | |
value: true | |
- name: non-opt | |
value: false | |
target: | |
- name: Graviton2 | |
ec2_instance_type: t4g.small | |
ec2_ami: ubuntu-latest (aarch64) | |
archflags: -mcpu=cortex-a76 -march=armv8.2-a | |
cflags: -DFORCE_AARCH64 | |
- name: Graviton3 | |
ec2_instance_type: c7g.medium | |
ec2_ami: ubuntu-latest (aarch64) | |
archflags: -march=armv8.4-a+sha3 | |
cflags: -DFORCE_AARCH64 | |
uses: ./.github/workflows/bench_ec2_reusable.yml | |
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main') | |
with: | |
ec2_instance_type: ${{ matrix.target.ec2_instance_type }} | |
ec2_ami: ${{ matrix.target.ec2_ami }} | |
archflags: ${{ matrix.target.archflags }} | |
cflags: ${{ matrix.target.cflags }} | |
opt: ${{ matrix.opt.value }} | |
store_results: ${{ matrix.opt.value && github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }} # Only store optimized results | |
name: ${{ matrix.target.name }} | |
secrets: inherit |