Skip to content

Commit dc04ea2

Browse files
authored
Add benchmark (#28)
* fix: typo readme.md * refactor: sortBase() as a method of model.Base * feat: added benchmark * fix: rm venom output
1 parent 79c88b5 commit dc04ea2

File tree

5 files changed

+11
-145
lines changed

5 files changed

+11
-145
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,12 @@ jobs:
4646
-e PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/vscode/go/bin:/workspace/bin \
4747
ci \
4848
neon -props "{tag: ${CI_ACTION_REF_NAME}, MODULE: github.com/${CI_REPOSITORY,,}, BY: ${CI_ACTOR}}" test-int
49+
50+
- name: Store benchmark result
51+
uses: benchmark-action/github-action-benchmark@v1
52+
with:
53+
tool: "go"
54+
output-file-path: bin/benchstats.txt
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
auto-push: ${{ env.CI_REF_NAME == 'main' }}
57+
fail-on-alert: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ testdata/benchmark/**/*.yaml
1111

1212
test/suites/cli/rimo.schema.json
1313
test/suites/testdata/data1/output/data.yaml
14+
test/suites/testdata/data1/output/data.yaml

build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ targets:
237237
doc: "Run all benchmarks"
238238
depends: ["info", "refresh", "lint", "bench-data"]
239239
steps:
240-
- $: go test -bench=. -benchmem -coverprofile=./={BUILD_DIR}/coverage_benchmark.txt -covermode=atomic ./...
240+
- $: go test -bench=. -benchmem ./... -run=^# -benchtime=1s | tee ./={BUILD_DIR}/benchstats.txt
241241

242242
test:
243243
doc: "Run all tests with coverage"

test/suites/testdata/data1/output/.gitkeep

Whitespace-only changes.

test/suites/testdata/data1/output/data.yaml

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)