|
| 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