aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/trunk.yml
diff options
context:
space:
mode:
authorsudoforge <no-reply@sudoforge.com>2024-07-22 23:10:02 -0700
committersudoforge <9c001b67637a@sudoforge.com>2024-07-22 23:27:09 -0700
commit5eabe549e4f7fc98bbdf4e7b285cec00e5da4e99 (patch)
treeacc81e739fc19376e4c9791a6525dd2874eef14c /.github/workflows/trunk.yml
parente4c74ef58671c64c029837b7f3869f6b127f00a7 (diff)
downloadgit-bug-5eabe549e4f7fc98bbdf4e7b285cec00e5da4e99.tar.gz
feat: refactor pipelines into reusable workflows
This change refactors the build, test, and benchmarking pipelines to a `presubmit` and `trunk` parent workflow which invokes other reusable workflows. This simplifies the deluge of pipelines that are executed, allowing for better orchestration and reduced noise on failures (only one email will be sent instead of several). Closes: michaelmure/git-bug#1198 Change-Id: I52407c39366bb9fbfd8fc1455a4f4a1d94f04897
Diffstat (limited to '.github/workflows/trunk.yml')
-rw-r--r--.github/workflows/trunk.yml48
1 files changed, 48 insertions, 0 deletions
diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml
new file mode 100644
index 00000000..ad6b9094
--- /dev/null
+++ b/.github/workflows/trunk.yml
@@ -0,0 +1,48 @@
+# //.github/workflows:trunk.yml
+#
+# This file exists to define the steps executed for a push to the default tree.
+# For configuring the steps that occur after a push to all other branches under
+# the refs/heads namespace, see `//.github/workflows:presubmit.yml`.
+---
+name: trunk
+
+on:
+ push:
+ branches:
+ - master
+
+concurrency:
+ group: ${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ lint:
+ uses: ./.github/workflows/lint.yml
+
+ build-and-test:
+ uses: ./.github/workflows/build-and-test.yml
+ secrets: inherit
+
+ benchmark:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ deployments: write
+ steps:
+ - uses: actions/setup-go@v5
+ with:
+ go-version: 1.22.5
+
+ - uses: actions/checkout@v4
+
+ - name: Run benchmark
+ run: go test -v ./... -bench=. -run=xxx -benchmem | tee output.txt
+
+ - name: Store benchmark result
+ uses: benchmark-action/github-action-benchmark@v1
+ with:
+ tool: 'go'
+ output-file-path: output.txt
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ comment-on-alert: true
+ auto-push: true