From d04806659f9300ffd071d0bf8602a6ec1bcbbcb9 Mon Sep 17 00:00:00 2001 From: David Sevilla Date: Tue, 16 May 2023 16:29:46 -0400 Subject: [PATCH 1/5] Attempt 1 --- .github/workflows/test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af35589..418795a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,3 +24,24 @@ jobs: run: go test -v ./... - name: test-race run: go test -v -race ./... + - name: fetch-previous-benchmark + uses: actions/cache@v1 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + - name: benchmark + run: go test -bench ./... | tee benchmarks.txt + - name: store-current-benchmark + uses: benchmark-action/github-action-benchmark@v1 + with: + name: idk + 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 + From b17e1adc1d3e39bdd9747949f13dedac9923ce5d Mon Sep 17 00:00:00 2001 From: David Sevilla Date: Tue, 16 May 2023 16:36:33 -0400 Subject: [PATCH 2/5] Attempt 2: permissions --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 418795a..31f14ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,8 @@ on: - main pull_request: permissions: - contents: read + contents: write + deployments: write jobs: test: name: test From a484aafe1f45a7dae270d753e24f6c8a0be56020 Mon Sep 17 00:00:00 2001 From: David Sevilla Date: Tue, 16 May 2023 16:42:19 -0400 Subject: [PATCH 3/5] Attempt 3: name change --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31f14ca..0ced641 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: - name: store-current-benchmark uses: benchmark-action/github-action-benchmark@v1 with: - name: idk + name: All Benchmarks tool: 'go' output-file-path: benchmarks.txt external-data-json-path: ./cache/benchmark-data.json From bbe0dd0b11c7235bff0d7481e93ff67bcc653839 Mon Sep 17 00:00:00 2001 From: David Sevilla Date: Tue, 16 May 2023 16:46:06 -0400 Subject: [PATCH 4/5] Slow down marshal --- marshal.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/marshal.go b/marshal.go index 4893eaf..be5504c 100644 --- a/marshal.go +++ b/marshal.go @@ -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 From 88d390514dbea49f85a854ebd650b41ffaa5601f Mon Sep 17 00:00:00 2001 From: David Sevilla Date: Tue, 16 May 2023 17:12:52 -0400 Subject: [PATCH 5/5] Switch to v3 cache --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ced641..9d9f8fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,13 +25,13 @@ 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@v1 + uses: actions/cache@v3 with: path: ./cache key: ${{ runner.os }}-benchmark - - name: benchmark - run: go test -bench ./... | tee benchmarks.txt - name: store-current-benchmark uses: benchmark-action/github-action-benchmark@v1 with: