Skip to content

benchmark_results

benchmark_results #22

name: process benchmark results
on:
repository_dispatch:
types: [benchmark_results]
jobs:
PROCESS_RESULTS:
permissions:
contents: 'write'
id-token: 'write'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Parse triggering request
shell: bash
run: |
echo "asset: ${{ github.event.client_payload.asset }}"
echo "(upstream) run_id: ${{ github.event.client_payload.run_id }}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_GHA_SA }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 473.0.0'
- name: Download GHA-formatted JSON files
shell: bash
run: |
base_path="${{ secrets.GCP_BUILD_ASSETS }}"
run_id="${{ github.event.client_payload.run_id }}"
asset="${{ github.event.client_payload.asset }}"
mkdir downloads
gcloud storage cp \
"$base_path/$run_id/$asset/*.json" \
downloads
ls -RA downloads
- name: nm-github-action-benchmark(bigger_is_better.json)
# Absence of the file indicates that there were no "bigger_is_better" metrics
if: hashFiles('downloads/bigger_is_better.json') != ''
uses: ./.github/actions/nm-github-action-benchmark
with:
gh_action_benchmark_name: "bigger_is_better"
gh_action_benchmark_json_file_path: "downloads/bigger_is_better.json"
gh_action_benchmark_tool: "customBiggerIsBetter"
gh_pages_branch: "nm-gh-pages"
auto_push: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: nm-github-action-benchmark(smaller_is_better.json)
# Absence of the file indicates that there were no "smaller_is_better" metrics
if: hashFiles('downloads/smaller_is_better.json') != ''
uses: ./.github/actions/nm-github-action-benchmark
with:
gh_action_benchmark_name: "smaller_is_better"
gh_action_benchmark_json_file_path: "downloads/smaller_is_better.json"
gh_action_benchmark_tool: "customSmallerIsBetter"
gh_pages_branch: "nm-gh-pages"
auto_push: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: nm-github-action-benchmark(observation_metrics.json)
# Absence of the file indicates that there were no "observation" metrics
if: hashFiles('downloads/observation_metrics.json') != ''
uses: ./.github/actions/nm-github-action-benchmark
with:
gh_action_benchmark_name: "observation_metrics"
gh_action_benchmark_json_file_path: "downloads/observation_metrics.json"
# `github-action-benchmark` expects a tool name that is either
# "customBiggerIsBetter" or "customSmallerIsBetter". This is a hack to
# work around that. Since we mark the action to not report failures, this
# is fine.
gh_action_benchmark_tool: "customBiggerIsBetter"
gh_pages_branch: "nm-gh-pages"
auto_push: true
github_token: ${{ secrets.GITHUB_TOKEN }}