diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d3e649b..39938b3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,37 +8,11 @@ permissions: contents: write deployments: write +env: + GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }} + jobs: benchmark: name: Execute Benchmarks - strategy: - matrix: - go-version: [1.19.x] - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - stable: false - - name: Checkout code - uses: actions/checkout@v3 - - name: Run benchmark - run: go test -bench=. ./... | tee output.txt - - name: Download previous benchmark data - uses: actions/cache@v3 - with: - path: ./cache - key: ${{ runner.os }}-benchmark - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - with: - name: Benchmark Results - tool: 'go' - output-file-path: output.txt - benchmark-data-dir-path: dev/bench - github-token: ${{ secrets.GITHUB_TOKEN }} - auto-push: true - alert-threshold: '200%' - comment-on-alert: true - fail-on-alert: true - alert-comment-cc-users: '@benjivesterby' + uses: devnw/workflows/.github/workflows/make-bench.yml@main + secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9b1c6c..e2fbaa9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,50 +4,11 @@ on: push: tags: - "v*" +env: + GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }} jobs: - build: - name: Make Build - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - fail-fast: true - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{ vars.GO_VERSION }} - stable: false - - - name: Build - run: make build-ci - - - name: Upload Test Coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage.txt - - - name: Upload Fuzz Results - uses: actions/upload-artifact@v3 - with: - name: fuzz-results - path: testdata/fuzz - release: - needs: [build] - name: "Tagged Release" - runs-on: "ubuntu-latest" - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Create Github Release from Tag - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: false - files: | - LICENSE + name: Tagged Release + uses: devnw/workflows/.github/workflows/make-release.yml@main + secrets: inherit # pragma: allowlist secret diff --git a/Makefile b/Makefile index 592fca2..3d6b8bf 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,8 @@ fuzz: done; \ done - +bench: + go test -bench=. -benchmem ./... lint: tidy golangci-lint run @@ -80,6 +81,8 @@ test-ci: deps tidy lint build-ci: test-ci $(env) go build ./... +bench-ci: test-ci + go test -bench=. ./... | tee output.txt release-ci: build-ci goreleaser release --rm-dist