-
Notifications
You must be signed in to change notification settings - Fork 49
92 lines (73 loc) · 3.09 KB
/
Copy pathbenchmark_cargo_slang_v2.yml
File metadata and controls
92 lines (73 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: "benchmark_cargo_slang_v2"
on:
# Run using manual triggers from GitHub UI:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
inputs:
dryRun:
description: "Attempt a local run and report results here, without updating the bencher dashboard."
type: "boolean"
required: true
default: true
bencherProject:
description: "Bencher project:"
type: "string"
# Run on pushes to 'main' branch:
push:
branches:
- "main"
# Run on every pull request (full benchmark, non-blocking):
pull_request:
types:
- "opened"
- "synchronize"
- "reopened"
permissions: {}
# Queue benchmark workflows for the same branch (main pushes queue for ordered results; PR runs cancel stale ones):
concurrency:
group: "${{ github.workflow }}-${{ github.ref_name }}"
cancel-in-progress: "${{ github.event_name == 'pull_request' }}"
jobs:
benchmark:
runs-on: "ubuntu-24.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)
permissions:
contents: "read"
pull-requests: "write"
# Skip fork PRs (can't access BENCHER_API_TOKEN). For non-PR events, only run on the main repo.
if: >-
${{
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|| (github.event_name != 'pull_request' && (github.repository == 'NomicFoundation/slang' || inputs.dryRun == true))
}}
steps:
- name: "Checkout Repository"
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
with:
persist-credentials: false
fetch-depth: 0 # Full history is needed by 'git/restore-mtime' to find each file's last commit time.
- name: "Free up disk space"
uses: "./.github/actions/free-disk-space"
- name: "Restore file mtimes from git"
uses: "./.github/actions/git/restore-mtime"
- name: "Restore Dependencies Cache"
uses: "./.github/actions/cache/dependencies/restore"
- name: "Restore Cargo Target Cache"
uses: "./.github/actions/cache/cargo-target/restore"
- name: "infra setup cargo pipenv"
run: "./scripts/bin/infra setup cargo pipenv"
- name: "Set bencher project"
run: |
echo "SLANG_BENCHER_PROJECT=${{ inputs.bencherProject }}" >> $GITHUB_ENV
if: "${{ inputs.bencherProject }}"
- name: "Benchmark > infra perf cargo slang-v2"
run: "./scripts/bin/infra perf cargo ${{ github.event_name == 'pull_request' && '--pr-benchmark' || (inputs.dryRun == true && '--dry-run' || '') }} slang-v2"
env:
BENCHER_API_TOKEN: "${{ secrets.BENCHER_API_TOKEN }}"
BENCHER_PR_HEAD_HASH: "${{ github.event.pull_request.head.sha }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Benchmark > Upload Benchmarking Data"
uses: "actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" # v7.0.1
with:
name: "benchmarking-data"
path: "target/iai"
if-no-files-found: "error"