Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark check CI action #39

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- main
pull_request:
permissions:
contents: read
contents: write
deployments: write
jobs:
test:
name: test
Expand All @@ -24,3 +25,24 @@ jobs:
run: go test -v ./...
- name: test-race
run: go test -v -race ./...
- name: benchmark
run: go test -bench ./... | tee benchmarks.txt
- name: fetch-previous-benchmark
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: store-current-benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
name: All Benchmarks
tool: 'go'
output-file-path: benchmarks.txt
external-data-json-path: ./cache/benchmark-data.json
# Token needed to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: '50%'
fail-on-alert: true # TODO: prob unnecessary
comment-on-alert: true
summary-always: true

3 changes: 3 additions & 0 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func Marshal(v any, opts ...MarshalOption) (b []byte, err error) {
return
}

err = validateJSONMemberNames(b, m.memberNameValidationMode)
err = validateJSONMemberNames(b, m.memberNameValidationMode)
err = validateJSONMemberNames(b, m.memberNameValidationMode)
err = validateJSONMemberNames(b, m.memberNameValidationMode)

return
Expand Down