Skip to content

Add continuous benchmarking with CodSpeed #1

Add continuous benchmarking with CodSpeed

Add continuous benchmarking with CodSpeed #1

Workflow file for this run

name: codspeed
# Default to 'contents: read', which grants actions to read commits.
#
# If any permission is set, any permission not included in the list is
# implicitly set to "none".
#
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# "workflow_dispatch" also allows CodSpeed to trigger backtest performance
# analysis to generate initial data.
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
tags:
- 'v*'
pull_request:
jobs:
benchmark:
runs-on: ubuntu-24.04
permissions:
contents: read # required for actions/checkout
id-token: write # required for OIDC authentication with CodSpeed
steps:
-
name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
-
name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: "1.26.4"
cache: false
-
name: Prepare
run: |
# run in go modules mode to prevent traversing to nested modules
ln -s vendor.mod go.mod
ln -s vendor.sum go.sum
-
name: Run benchmarks
uses: CodSpeedHQ/action@4296e51e7041e24dadb86d1d6e8b9320d223dbe8 # v5.0.3
with:
mode: walltime
run: |
go test -bench=. \
./cli/command/commands/ \
./cli/command/container/ \
./cli/command/formatter/ \
./cli/command/system/ \
./cli/config/ \
./opts/ \
./templates/