Skip to content

Commit aec0a53

Browse files
authored
(infra) splitting perf cargo workflows into their own flows (#1442)
1 parent 03ff18e commit aec0a53

File tree

2 files changed

+66
-20
lines changed

2 files changed

+66
-20
lines changed
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ on:
1111
required: true
1212
default: true
1313

14-
bencherProjectSlang:
15-
description: "Bencher project (Slang tests):"
16-
type: "string"
17-
18-
bencherProjectCmp:
19-
description: "Bencher project (comparisons):"
14+
bencherProject:
15+
description: "Bencher project:"
2016
type: "string"
2117

2218
# Run on pushes to 'main' branch:
@@ -46,22 +42,11 @@ jobs:
4642
- name: "infra setup cargo"
4743
run: "./scripts/bin/infra setup cargo"
4844

49-
- name: "Set bencher project (Slang)"
50-
51-
run: |
52-
echo "SLANG_BENCHER_PROJECT=${{ inputs.bencherProjectSlang }}" >> $GITHUB_ENV
53-
if: "${{ inputs.bencherProjectSlang }}"
54-
55-
- name: "infra perf cargo slang"
56-
run: "./scripts/bin/infra perf cargo ${{ inputs.dryRun == true && '--dry-run' || '' }} slang"
57-
env:
58-
BENCHER_API_TOKEN: "${{ secrets.BENCHER_API_TOKEN }}"
59-
60-
- name: "Set bencher project (comparisons)"
45+
- name: "Set bencher project"
6146

6247
run: |
63-
echo "SLANG_BENCHER_PROJECT=${{ inputs.bencherProjectCmp }}" >> $GITHUB_ENV
64-
if: "${{ inputs.bencherProjectCmp }}"
48+
echo "SLANG_BENCHER_PROJECT=${{ inputs.bencherProject }}" >> $GITHUB_ENV
49+
if: "${{ inputs.bencherProject }}"
6550

6651
- name: "infra perf cargo comparison"
6752
run: "./scripts/bin/infra perf cargo ${{ inputs.dryRun == true && '--dry-run' || '' }} comparison"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "benchmark_cargo"
2+
3+
on:
4+
# Run using manual triggers from GitHub UI:
5+
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
6+
workflow_dispatch:
7+
inputs:
8+
dryRun:
9+
description: "Attempt a local run and report results here, without updating the bencher dashboard."
10+
type: "boolean"
11+
required: true
12+
default: true
13+
14+
bencherProject:
15+
description: "Bencher project:"
16+
type: "string"
17+
18+
# Run on pushes to 'main' branch:
19+
push:
20+
branches:
21+
- "main"
22+
23+
# Queue up benchmark workflows for the same branch, so that results are reported in order:
24+
concurrency:
25+
group: "${{ github.workflow }}-${{ github.ref_name }}"
26+
cancel-in-progress: false
27+
28+
jobs:
29+
benchmark:
30+
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)
31+
32+
# Only run on the main repo (not forks), unless it is a dry run:
33+
if: "${{ github.repository == 'NomicFoundation/slang' || inputs.dryRun == true }}"
34+
35+
steps:
36+
- name: "Checkout Repository"
37+
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
38+
39+
- name: "Restore Cache"
40+
uses: "./.github/actions/cache/restore"
41+
42+
- name: "infra setup cargo"
43+
run: "./scripts/bin/infra setup cargo"
44+
45+
- name: "Set bencher project"
46+
47+
run: |
48+
echo "SLANG_BENCHER_PROJECT=${{ inputs.bencherProject }}" >> $GITHUB_ENV
49+
if: "${{ inputs.bencherProject }}"
50+
51+
- name: "infra perf cargo slang"
52+
run: "./scripts/bin/infra perf cargo ${{ inputs.dryRun == true && '--dry-run' || '' }} slang"
53+
env:
54+
BENCHER_API_TOKEN: "${{ secrets.BENCHER_API_TOKEN }}"
55+
56+
- name: "Upload Benchmarking Data"
57+
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
58+
with:
59+
name: "benchmarking-data"
60+
path: "target/iai"
61+
if-no-files-found: "error"

0 commit comments

Comments
 (0)