forked from gravitational/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (86 loc) · 3.07 KB
/
Copy pathbenchmark-code-root.yaml
File metadata and controls
98 lines (86 loc) · 3.07 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Benchmarks Diff (Root) (Go)
run-name: Benchmarks Diff (Root) (Go) - ${{ github.run_id }} - @${{ github.actor }}
on:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
changes:
name: Check for relevant changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ steps.changes.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
base: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
filters: |
changed:
- '.github/workflows/benchmark-code-root.yaml'
- '**.go'
- 'go.mod'
- 'go.sum'
- 'build.assets/Makefile'
- 'build.assets/Dockerfile*'
- 'Makefile'
benchmark:
name: Benchmarks (Root) (Go)
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: ubuntu-22.04-32core
permissions:
contents: read
container:
image: ghcr.io/gravitational/teleport-buildbox:teleport19
options: --cap-add=SYS_ADMIN --privileged
env:
TELEPORT_XAUTH_TEST: yes
WEBASSETS_SKIP_BUILD: 1
BENCH_TIME: "2s"
BENCH_COUNT: 10
GIT_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before }}
GIT_HEAD_SHA: ${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Prepare workspace
uses: ./.github/actions/prepare-workspace
- name: Run head benchmarks
timeout-minutes: 10
run: |
make test-go-bench-root BENCH_OUTPUT=test-logs/bench-${GIT_HEAD_SHA}.txt
- name: Checkout base commit
uses: actions/checkout@v6
with:
clean: false # Preserve previous results
ref: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before }}
- name: Run base benchmarks
timeout-minutes: 10
run: |
make test-go-bench-root BENCH_OUTPUT=test-logs/bench-${GIT_BASE_SHA}.txt
- name: Generate benchstat output
shell: bash
run: |
make benchstat BENCH_FILES="test-logs/bench-${GIT_BASE_SHA}.txt test-logs/bench-${GIT_HEAD_SHA}.txt"
- name: Publish benchstat summary
shell: bash
run: |
{
echo "## Go benchmark diff"
echo ""
echo "**Base:** \`${GIT_BASE_SHA}\`"
echo "**Head:** \`${GIT_HEAD_SHA}\`"
echo ""
echo '```'
cat test-logs/benchstat.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"