trunk.yml

 1# //.github/workflows:trunk.yml
 2#
 3# This file exists to define the steps executed for a push to the default tree.
 4# For configuring the steps that occur after a push to all other branches under
 5# the refs/heads namespace, see `//.github/workflows:presubmit.yml`.
 6---
 7name: trunk
 8
 9on:
10  push:
11    branches:
12      - master
13
14concurrency:
15  group: ${{ github.ref }}
16  cancel-in-progress: true
17
18jobs:
19  build-and-test:
20    uses: ./.github/workflows/build-and-test.yml
21    secrets: inherit
22
23  benchmark:
24    runs-on: ubuntu-latest
25    permissions:
26      contents: write
27      deployments: write
28    steps:
29      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30
31      - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
32        with:
33          go-version: 1.24.2
34
35      - name: Run benchmark
36        run: go test -v ./... -bench=. -run=xxx -benchmem | tee output.txt
37
38      - name: Store benchmark result
39        uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4
40        with:
41          tool: 'go'
42          output-file-path: output.txt
43          github-token: ${{ secrets.GITHUB_TOKEN }}
44          comment-on-alert: true
45          auto-push: true