@@ -11,7 +11,7 @@ permissions:
11
11
12
12
jobs :
13
13
bencher_upload :
14
- name : Upload to bencher.dev
14
+ name : Upload
15
15
# The bench workflow fails when a regression is detected, but we want to upload results regardless.
16
16
if : github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure'
17
17
permissions :
23
23
BENCHER_API_TOKEN : ${{ secrets.BENCHER_API_TOKEN }}
24
24
GITHUB_EVENT_PATH : event.json
25
25
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
+ SHA : ${{ github.event.workflow_run.referenced_workflows[0].sha != '' && github.event.workflow_run.referenced_workflows[0].sha || github.event.workflow_run.head_sha }}
27
+ DATA_TAG : ${{ github.event.workflow.name == 'cargo bench' && 'bench' || 'perfcompare' }}
26
28
27
29
steps :
28
30
- env :
34
36
uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
35
37
with :
36
38
run-id : ${{ github.event.workflow_run.id }}
37
- name : ${{ github.event.repository.name }}-${{ github.event.workflow_run.referenced_workflows[0].sha != '' && github.event.workflow_run.referenced_workflows[0].sha || github.event.workflow_run.head_sha }}-bench -perf
39
+ name : ${{ github.event.repository.name }}-${{ env.SHA }}-${{ env.DATA_TAG }} -perf
38
40
github-token : ${{ secrets.GITHUB_TOKEN }}
39
41
40
42
- name : Export PR event data
@@ -50,22 +52,10 @@ jobs:
50
52
51
53
-
uses :
bencherdev/[email protected] # zizmor: ignore[unpinned-uses]
52
54
53
- - name : Upload main-branch results to bencher.dev
55
+ - name : Upload main-branch results
54
56
run : |
55
57
ls -la
56
- bencher run \
57
- --branch main \
58
- --hash "$(cat main-sha.txt)" \
59
- --testbed "$(cat testbed.txt)" \
60
- --threshold-measure latency \
61
- --threshold-test t_test \
62
- --threshold-upper-boundary 0.99 \
63
- --thresholds-reset \
64
- --err \
65
- --adapter rust_criterion \
66
- --github-actions "$GITHUB_TOKEN" \
67
- --file results-main.txt
68
- for file in hyperfine-main/*.json; do
58
+ if [ "$DATA_TAG" == "bench" ]; then
69
59
bencher run \
70
60
--branch main \
71
61
--hash "$(cat main-sha.txt)" \
@@ -75,27 +65,32 @@ jobs:
75
65
--threshold-upper-boundary 0.99 \
76
66
--thresholds-reset \
77
67
--err \
78
- --adapter shell_hyperfine \
68
+ --adapter rust_criterion \
79
69
--github-actions "$GITHUB_TOKEN" \
80
- --file "$file"
81
- done
70
+ --file results-main.txt
71
+ else
72
+ ls -la hyperfine-main
73
+ for file in hyperfine-main/*.json; do
74
+ bencher run \
75
+ --branch main \
76
+ --hash "$(cat main-sha.txt)" \
77
+ --testbed "$(cat testbed.txt)" \
78
+ --threshold-measure latency \
79
+ --threshold-test t_test \
80
+ --threshold-upper-boundary 0.99 \
81
+ --thresholds-reset \
82
+ --err \
83
+ --adapter shell_hyperfine \
84
+ --github-actions "$GITHUB_TOKEN" \
85
+ --file "$file"
86
+ done
87
+ fi
82
88
83
- - name : Upload PR results to bencher.dev
89
+ - name : Upload PR results
84
90
if : env.PR_HEAD != '' && env.PR_BASE != '' && env.PR_BASE_SHA != '' && env.PR_NUMBER != ''
85
91
run : |
86
- bencher run \
87
- --branch "$PR_HEAD" \
88
- --testbed "$(cat testbed.txt)" \
89
- --start-point "$PR_BASE" \
90
- --start-point-hash "$PR_BASE_SHA" \
91
- --start-point-clone-thresholds \
92
- --start-point-reset \
93
- --err \
94
- --adapter rust_criterion \
95
- --github-actions "$GITHUB_TOKEN" \
96
- --ci-number "$PR_NUMBER" \
97
- --file results.txt
98
- for file in hyperfine/*neqo*.json; do
92
+ ls -la
93
+ if [ "$DATA_TAG" == "bench" ]; then
99
94
bencher run \
100
95
--branch "$PR_HEAD" \
101
96
--testbed "$(cat testbed.txt)" \
@@ -104,8 +99,24 @@ jobs:
104
99
--start-point-clone-thresholds \
105
100
--start-point-reset \
106
101
--err \
107
- --adapter shell_hyperfine \
102
+ --adapter rust_criterion \
108
103
--github-actions "$GITHUB_TOKEN" \
109
104
--ci-number "$PR_NUMBER" \
110
- --file "$file"
111
- done
105
+ --file results.txt
106
+ else
107
+ ls -la hyperfine
108
+ for file in hyperfine/*neqo*.json; do
109
+ bencher run \
110
+ --branch "$PR_HEAD" \
111
+ --testbed "$(cat testbed.txt)" \
112
+ --start-point "$PR_BASE" \
113
+ --start-point-hash "$PR_BASE_SHA" \
114
+ --start-point-clone-thresholds \
115
+ --start-point-reset \
116
+ --err \
117
+ --adapter shell_hyperfine \
118
+ --github-actions "$GITHUB_TOKEN" \
119
+ --ci-number "$PR_NUMBER" \
120
+ --file "$file"
121
+ done
122
+ fi
0 commit comments