Skip to content

[v2] Compute linearised members of all contracts in a new semantic pass #1164

[v2] Compute linearised members of all contracts in a new semantic pass

[v2] Compute linearised members of all contracts in a new semantic pass #1164

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: "Smoke Test > infra perf cargo --smoke slang-v2"
if: "${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:perf') }}"
run: "./scripts/bin/infra perf cargo --smoke slang-v2"
- 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:
SLANG_BENCHER_PROJECT: "${{ inputs.bencherProject }}"
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"