Add github benchmark action #51
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 | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
types: [ "labeled" ] | |
jobs: | |
bench: | |
runs-on: self-hosted-rpi4 | |
if: github.repository_owner == 'pq-code-package' && (contains(github.event.pull_request.labels.*.name, 'benchmark') || github.ref == 'refs/heads/main') | |
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.cross_prefix }}gcc --version | grep -m1 "") | |
- $(bash --version | grep -m1 "") | |
## CPU Info | |
$(cat /proc/cpuinfo) | |
EOF | |
- name: Run benchmark | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
tests bench -c PMU --cflags -mcpu=cortex-a72 -v --resultfile output.json | |
- name: Merge benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Arm Cortex-A72 (Raspberry Pi 4) benchmarks | |
tool: 'customSmallerIsBetter' | |
output-file-path: output.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: false | |
- name: Push benchmark results | |
run: | | |
git config --global user.name "oqs-bot" | |
git config --global user.email "[email protected]" | |
git push gh-pages:gh-pages --no-verify | |