diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml deleted file mode 100644 index 11853c2cd3..0000000000 --- a/.github/workflows/benchmark.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: "Benchmarks" -on: # yamllint disable-line rule:truthy - push: - branches: - - "main" - pull_request: - branches: - - "*" - merge_group: - types: - - "checks_requested" -env: - GO_VERSION: "~1.20.5" -jobs: - go-bench: - name: "Go Benchmark" - runs-on: ["self-hosted", "benchmarks"] - needs: "unit" - steps: - - uses: "actions/checkout@v3" - - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - - name: "Benchmark" - run: "go run mage.go test:bench | tee benchmarks.txt" - - name: "Download previous benchmark data" - uses: "actions/cache@v1" - with: - path: "./cache" - key: "${{ runner.os }}-benchmark" - - uses: "benchmark-action/github-action-benchmark@v1" - with: - tool: "go" - output-file-path: "benchmarks.txt" - save-data-file: "${{ github.ref_name == 'main' }}" - external-data-json-path: "./cache/benchmark-data.json" - github-token: "${{ github.token }}" - auto-push: false - comment-on-alert: true - summary-always: true diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index e2d02dbcc0..9cf33629ab 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -241,3 +241,31 @@ jobs: input: "proto/internal" against: "https://github.com/authzed/spicedb.git#branch=main,subdir=proto/internal" buf_token: "${{ secrets.BUF_REGISTRY_TOKEN }}" + go-bench: + name: "Go Benchmark" + runs-on: ["self-hosted", "benchmarks"] + needs: "paths-filter" + if: | + needs.paths-filter.outputs.codechange == 'true' + steps: + - uses: "actions/checkout@v3" + - uses: "authzed/actions/setup-go@main" + with: + go-version: "${{ env.GO_VERSION }}" + - name: "Benchmark" + run: "go run mage.go test:bench | tee benchmarks.txt" + - name: "Download previous benchmark data" + uses: "actions/cache@v1" + with: + path: "./cache" + key: "${{ runner.os }}-benchmark" + - uses: "benchmark-action/github-action-benchmark@v1" + with: + tool: "go" + output-file-path: "benchmarks.txt" + save-data-file: "${{ github.ref_name == 'main' }}" + external-data-json-path: "./cache/benchmark-data.json" + github-token: "${{ github.token }}" + auto-push: false + comment-on-alert: true + summary-always: true