Skip to content

Commit 6226216

Browse files
committed
feat(ci): Enable benchmark jobs
1 parent 13e4b21 commit 6226216

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,30 @@ jobs:
267267
exit 1
268268
fi
269269
done
270+
271+
benchmark:
272+
runs-on: windows-latest
273+
needs:
274+
- build
275+
steps:
276+
- name: Checkout
277+
uses: actions/checkout@v4
278+
- name: Install Go
279+
uses: actions/setup-go@v5
280+
with:
281+
go-version: ${{ env.GO_VERSION }}
282+
- name: Benchmark
283+
run: |
284+
./make bench | Tee-Object -FilePath output.txt
285+
- name: Download previous benchmark data
286+
uses: actions/cache@v4
287+
with:
288+
path: ./cache
289+
key: ${{ runner.os }}-benchmark
290+
- name: Store benchmark result
291+
uses: benchmark-action/github-action-benchmark@v1
292+
with:
293+
tool: 'go'
294+
output-file-path: output.txt
295+
external-data-json-path: ./cache/benchmark-data.json
296+
fail-on-alert: true

make.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set GOBIN=%USERPROFILE%\go\bin
2121
set GOTEST=go test -timeout=10m -v -gcflags=all=-d=checkptr=0
2222
set GOFMT=gofmt -e -s -l -w
2323
set GOLINT=%GOBIN%\golangci-lint
24+
set GOBENCH=go test ./... -run='^$' -bench=Benchmark -benchmem
2425

2526
if NOT DEFINED VERSION (
2627
set VERSION="0.0.0"
@@ -56,6 +57,7 @@ if "%~1"=="install" goto install
5657
if "%~1"=="deps" goto deps
5758
if "%~1"=="rsrc" goto rsrc
5859
if "%~1"=="mc" goto mc
60+
if "%~1"=="bench" goto bench
5961

6062
:build
6163
:: set PKG_CONFIG_PATH=pkg-config
@@ -101,6 +103,11 @@ gcc pkg/outputs/eventlog/mc/fibratus.res -o pkg/outputs/eventlog/mc/fibratus.dll
101103
if errorlevel 1 goto fail
102104
goto :EOF
103105

106+
:bench
107+
%GOBENCH%
108+
if errorlevel 1 goto fail
109+
goto :EOF
110+
104111
:pkg
105112
set RELEASE_DIR=.\build\msi\fibratus-%VERSION%
106113

0 commit comments

Comments
 (0)