forked from git-bug/git-bug
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.3 KB
/
trunk.yml
File metadata and controls
79 lines (68 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# //.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:
- trunk
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
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/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.24.2
- name: Run benchmark
run: go test -v ./... -bench=. -run=xxx -benchmem | tee output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4
with:
tool: 'go'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
auto-push: true
mirror:
if: github.repository == 'git-bug/git-bug' && github.run_attempt == '1'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
# we use a custom deploy key in order to allow the workflow to bypass
# branch protection rules. without this, pushing will be rejected
- name: setup authentication
env:
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
run: |
mkdir -p ~/.ssh
echo "${{ secrets.TRUNK_MIRROR_KEY }}" > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add ~/.ssh/id_rsa
- name: push to refs/heads/master
env:
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
run: |-
git config user.name git-bug-bot
git config user.email no-reply@git-bug.org
git remote set-url origin git@github.com:git-bug/git-bug.git
git push --atomic origin HEAD:refs/heads/master