Skip to content

Commit fc63264

Browse files
committed
feat: add cycle-estimation and exclude-allocations inputs
Both map to the runner's --cycle-estimation/--exclude-allocations flags and are only forwarded when set, so unset runs keep the runner defaults and pinned runners without the flags keep working.
1 parent 8847237 commit fc63264

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,18 @@ jobs:
162162
with:
163163
mode: memory
164164
config: .github/test-codspeed.yml
165+
166+
test-simulation-tuning-inputs:
167+
runs-on: ubuntu-latest
168+
env:
169+
CODSPEED_SKIP_UPLOAD: true
170+
steps:
171+
- uses: actions/checkout@v4
172+
- name: Check action with cycle-estimation and exclude-allocations
173+
uses: ./
174+
with:
175+
allow-empty: true
176+
mode: simulation
177+
cycle-estimation: "false"
178+
exclude-allocations: "true"
179+
run: echo "Testing simulation tuning inputs!"

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ GitHub Actions for running [CodSpeed](https://codspeed.io) in your CI.
7878
# [OPTIONAL]
7979
# The version of the go-runner to use (e.g., 1.0.0, 1.0.0-beta.1). If not specified, the latest version will be installed
8080
go-runner-version: ""
81+
82+
# [OPTIONAL]
83+
# Improve `simulation` accuracy by weighting each instruction by its estimated cycle
84+
# cost instead of charging every instruction the same fixed cost.
85+
# Set to "false" to disable. Requires runner v5 or later.
86+
# Defaults to "true".
87+
cycle-estimation: ""
88+
89+
# [OPTIONAL]
90+
# Exclude memory allocation time from `simulation` mode results. Set to "true" to
91+
# enable. Requires runner v5 or later.
92+
# Defaults to "false".
93+
exclude-allocations: ""
8194
```
8295
8396
# Example usage

‎action.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ inputs:
7878
description: "The version of the go-runner to use (e.g., 1.0.0, 1.0.0-beta.1). If not specified, the latest version will be installed"
7979
required: false
8080

81+
cycle-estimation:
82+
description: |
83+
Improve `simulation` accuracy by weighting each instruction by its estimated cycle cost instead of
84+
charging every instruction the same fixed cost. Set to 'false' to disable.
85+
Requires runner v5 or later. Defaults to 'true'.
86+
required: false
87+
88+
exclude-allocations:
89+
description: |
90+
Exclude memory allocation time from `simulation` mode results. Set to 'true' to enable.
91+
Requires runner v5 or later. Defaults to 'false'.
92+
required: false
93+
8194
config:
8295
description: "Path to a CodSpeed configuration file (codspeed.yml). If not specified, the runner will look for a codspeed.yml file in the repository root."
8396
required: false
@@ -263,6 +276,12 @@ runs:
263276
if [ -n "${{ inputs.config }}" ]; then
264277
RUNNER_ARGS+=(--config="${{ inputs.config }}")
265278
fi
279+
if [ -n "${{ inputs.cycle-estimation }}" ]; then
280+
RUNNER_ARGS+=(--cycle-estimation="${{ inputs.cycle-estimation }}")
281+
fi
282+
if [ -n "${{ inputs.exclude-allocations }}" ]; then
283+
RUNNER_ARGS+=(--exclude-allocations="${{ inputs.exclude-allocations }}")
284+
fi
266285
267286
if [ -n "$CODSPEED_INPUT_RUN" ]; then
268287
RUNNER_ARGS+=(-- "$CODSPEED_INPUT_RUN")

0 commit comments

Comments
 (0)