Skip to content

Run Benchmark

Run Benchmark #10

Workflow file for this run

name: Run Benchmark
on:
workflow_dispatch:
inputs:
run:
description: "Number of times to run the benchmark"
required: true
type: string
model:
description: "Model to use"
required: true
type: string
tasks:
description: "Comma-separated list of tasks"
required: true
type: string
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
tasks: ${{ steps.split.outputs.tasks }}
steps:
- name: Split tasks into matrix
id: split
run: |
TASKS_JSON=$(echo "${{ inputs.tasks }}" | tr ',' '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "tasks=$TASKS_JSON" >> $GITHUB_OUTPUT
benchmark:
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
task: ${{ fromJson(needs.prepare.outputs.tasks) }}
environment: production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.2.21
- name: Install dependencies
run: bun install
- name: Install OpenCode CLI
run: bun add -g opencode-ai
- name: Print benchmark config
env:
RUN_COUNT: ${{ inputs.run }}
MODEL: ${{ inputs.model }}
TASK: ${{ matrix.task }}
run: |
echo "Run count: ${RUN_COUNT}"
echo "Model: ${MODEL}"
echo "Task: ${TASK}"
- name: Run benchmark
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
DEBUG: true
run: bun dev opencode --task ${{ matrix.task }} --model ${{ inputs.model }}