Skip to content

Commit 5c220cb

Browse files
committed
Try out just running make for-all-target TARGET='benchmark'
Based on the last comment and on a local run, I think this could work, though it will probably run out of memory. Let's see
1 parent b7f73a3 commit 5c220cb

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

.github/workflows/go-benchmarks.yml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
pull_request:
88
workflow_dispatch:
99

10-
env:
11-
# renovate: datasource=github-releases depName=codspeed packageName=CodSpeedHQ/runner
12-
CODSPEED_RUNNER_VERSION: v4.3.4
13-
1410
jobs:
1511
benchmarks:
1612
name: Run benchmarks
@@ -31,30 +27,8 @@ jobs:
3127
~/go/bin
3228
~/go/pkg/mod
3329
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }}
34-
35-
# The following comes from https://github.com/CodSpeedHQ/action/blob/6a8e2b/action.yml with significant modifications.
36-
# Copyright (c) 2022 CodSpeed and contributors
37-
# TODO: Switch to a setup-codspeed action when available, see https://github.com/CodSpeedHQ/action/issues/146
38-
- name: Determine kernel version
39-
id: versions
40-
shell: bash
41-
run: |
42-
# Get kernel version for cache key
43-
KERNEL_VERSION=$(uname -r)
44-
echo "kernel-version=$KERNEL_VERSION" >> $GITHUB_OUTPUT
45-
- name: Cache CodSpeed instruments
46-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
30+
- name: Run the benchmarks
31+
uses: CodSpeedHQ/action@6a8e2b874c338bf81cc5e8be715ada75908d3871 # v4.3.4
4732
with:
48-
path: ~/.cache/codspeed-action
49-
key: codspeed-instruments-instrumentation-${{ runner.os }}-${{ runner.arch }}-${{steps.versions.outputs.kernel-version }}-${{ env.CODSPEED_RUNNER_VERSION }}
50-
restore-keys: |
51-
codspeed-instruments-instrumentation-${{ runner.os }}-${{ runner.arch }}-${{steps.versions.outputs.kernel-version }}-${{ env.CODSPEED_RUNNER_VERSION }}
52-
# TODO: Remove 'cargo install' once https://github.com/CodSpeedHQ/codspeed-go/issues/31 fix is released
53-
- name: Setup codspeed
54-
run: |
55-
curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/${{ env.CODSPEED_RUNNER_VERSION }}/codspeed-runner-installer.sh | bash -s -- --quiet
56-
cargo install --git https://github.com/CodSpeedHQ/codspeed-go/ --branch cod-1666-codspeed-go-is-unable-to-run-benchmarks-on-go-modules-with
57-
- name: Run benchmarks
58-
run: |
59-
make for-all-target TARGET="codspeed-benchmark"
60-
33+
mode: walltime
34+
run: make for-all-target TARGET="benchmark"'

Makefile.Common

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,5 @@ impi:
100100
moddownload:
101101
$(GOCMD) mod download
102102

103-
codspeed-benchmark:
104-
if go test ./... -list=Benchmark | grep -q Benchmark; then \
105-
codspeed run --mode walltime --setup-cache-dir=~/.cache/codspeed-action -- 'go test -bench=. ./...'; \
106-
rm -rf /tmp/* || true; \
107-
fi
103+
benchmark:
104+
go test -bench=. ./...

0 commit comments

Comments
 (0)