Skip to content

GHA pipeline rewrite for ease and speed #29

GHA pipeline rewrite for ease and speed

GHA pipeline rewrite for ease and speed #29

name: Benchmark PR
on:
push:
branches: [main]
pull_request:
paths:
- '.github/workflows/benchmark-auto-pr.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
benchmark:
permissions:
pull-requests: write
contents: write
id-token: write
runs-on: ubuntu-latest-8-cores
strategy:
matrix:
runtimes: [centrifuge, altair]
env:
RUST_TOOLCHAIN: "1.66.0"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
RUST_TOOLCHAIN: ${{ env.RUST_TOOLCHAIN }}
cache: enabled
# Cache needs Google credentials:
GWIP: ${{ secrets.GWIP_SCCACHE }}
GSA: ${{ secrets.GSA_SCCACHE }}
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: 'main'
- name: Run Benchmark ${{ matrix.runtimes }}
run: ./scripts/runtime_benchmarks.sh ${{ matrix.runtimes }}
- run: echo "NOW=$(date -u +%Y-%m-%d)" >> $GITHUB_ENV
- name: Create PR with new benchmarks
uses: peter-evans/create-pull-request@v5
with:
add-paths: runtime/${{ matrix.runtimes }}/src/weights/
base: main
branch: benchmarks/${{ matrix.runtimes }}-${{ env.NOW }}
delete-branch: true
reviewers: ${{ github.actor }}
draft: true
labels: gha, benchmarks
commit-message: "New benchmark weights generated from main by Github Actions Bot"
title: New benchmark weights for ${{ matrix.runtimes }}
body: |
Automated PR generated by Benchmark PR Github Actions job
Runtime: ${{ matrix.runtimes }}
Commit that triggered:
${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.runtimes }}-weights
# path: runtime/${{ matrix.runtimes }}/src/weights/