Skip to content

Commit bdb2c61

Browse files
committed
feat: migrating to shared benchmark workflow
1 parent f229905 commit bdb2c61

File tree

3 files changed

+14
-76
lines changed

3 files changed

+14
-76
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,11 @@ permissions:
88
contents: write
99
deployments: write
1010

11+
env:
12+
GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }}
13+
1114
jobs:
1215
benchmark:
1316
name: Execute Benchmarks
14-
strategy:
15-
matrix:
16-
go-version: [1.19.x]
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/setup-go@v4
20-
with:
21-
go-version: ${{ matrix.go-version }}
22-
stable: false
23-
- name: Checkout code
24-
uses: actions/checkout@v3
25-
- name: Run benchmark
26-
run: go test -bench=. ./... | tee output.txt
27-
- name: Download previous benchmark data
28-
uses: actions/cache@v3
29-
with:
30-
path: ./cache
31-
key: ${{ runner.os }}-benchmark
32-
- name: Store benchmark result
33-
uses: benchmark-action/github-action-benchmark@v1
34-
with:
35-
name: Benchmark Results
36-
tool: 'go'
37-
output-file-path: output.txt
38-
benchmark-data-dir-path: dev/bench
39-
github-token: ${{ secrets.GITHUB_TOKEN }}
40-
auto-push: true
41-
alert-threshold: '200%'
42-
comment-on-alert: true
43-
fail-on-alert: true
44-
alert-comment-cc-users: '@benjivesterby'
17+
uses: devnw/workflows/.github/workflows/make-bench.yml@main
18+
secrets: inherit # pragma: allowlist secret

.github/workflows/release.yml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,11 @@ on:
44
push:
55
tags:
66
- "v*"
7+
env:
8+
GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }}
79

810
jobs:
9-
build:
10-
name: Make Build
11-
strategy:
12-
matrix:
13-
platform: [ubuntu-latest, macos-latest, windows-latest]
14-
fail-fast: true
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Install Go
20-
uses: actions/setup-go@v4
21-
with:
22-
go-version: ${{ vars.GO_VERSION }}
23-
stable: false
24-
25-
- name: Build
26-
run: make build-ci
27-
28-
- name: Upload Test Coverage
29-
uses: actions/upload-artifact@v3
30-
with:
31-
name: coverage
32-
path: coverage.txt
33-
34-
- name: Upload Fuzz Results
35-
uses: actions/upload-artifact@v3
36-
with:
37-
name: fuzz-results
38-
path: testdata/fuzz
39-
4011
release:
41-
needs: [build]
42-
name: "Tagged Release"
43-
runs-on: "ubuntu-latest"
44-
steps:
45-
- name: Checkout code
46-
uses: actions/checkout@v4
47-
- name: Create Github Release from Tag
48-
uses: "marvinpinto/action-automatic-releases@latest"
49-
with:
50-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
51-
prerelease: false
52-
files: |
53-
LICENSE
12+
name: Tagged Release
13+
uses: devnw/workflows/.github/workflows/make-release.yml@main
14+
secrets: inherit # pragma: allowlist secret

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ fuzz:
3636
done; \
3737
done
3838

39-
39+
bench:
40+
go test -bench=. -benchmem ./...
4041

4142
lint: tidy
4243
golangci-lint run
@@ -80,6 +81,8 @@ test-ci: deps tidy lint
8081
build-ci: test-ci
8182
$(env) go build ./...
8283

84+
bench-ci: test-ci
85+
go test -bench=. ./... | tee output.txt
8386

8487
release-ci: build-ci
8588
goreleaser release --rm-dist

0 commit comments

Comments
 (0)