Benchmarks #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Benchmarks | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| target: | |
| description: 'Benchmark target' | |
| type: choice | |
| default: cloud | |
| options: | |
| - cloud | |
| - local | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| benchmark: | |
| name: Benchmark | |
| runs-on: macos-26 | |
| timeout-minutes: 60 | |
| env: | |
| LK_BENCHMARK: 1 | |
| LIVEKIT_URL: ${{ inputs.target != 'local' && secrets.BENCHMARK_URL || '' }} | |
| LIVEKIT_API_KEY: ${{ inputs.target != 'local' && secrets.BENCHMARK_API_KEY || '' }} | |
| LIVEKIT_API_SECRET: ${{ inputs.target != 'local' && secrets.BENCHMARK_API_SECRET || '' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: brew install livekit jemalloc swiftly && swiftly init --quiet-shell-followup --skip-install -y | |
| - name: Run LiveKit Server | |
| if: inputs.target == 'local' | |
| run: livekit-server --dev & | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest | |
| - name: Run Benchmarks | |
| working-directory: Benchmarks | |
| run: | | |
| swiftly run +xcode swift package --disable-sandbox \ | |
| benchmark baseline update current | |
| - name: Benchmark Report | |
| working-directory: Benchmarks | |
| env: | |
| TARGET: ${{ inputs.target || 'cloud' }} | |
| run: | | |
| { | |
| echo "## Target: \`${TARGET}\`" | |
| echo | |
| swiftly run +xcode swift package --disable-sandbox \ | |
| benchmark baseline read current --format markdown | |
| } | tee -a "$GITHUB_STEP_SUMMARY" |