File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 9
9
branches :
10
10
- master
11
11
12
+ # Responsibility is divided between two jobs "measure" and "report", so that the
13
+ # job that builds (and potentnially runs) untrusted code does not have PR write
14
+ # permission, and vice-versa.
12
15
jobs :
13
- test :
16
+ measure :
14
17
name : Check binary size
15
18
runs-on : ubuntu-latest
16
19
permissions :
17
- pull-requests : write
20
+ contents : read
18
21
env :
19
22
# This cannot be used as a context variable in the 'uses' key later. If it
20
23
# changes, update those steps too.
23
26
TEST_MAIN_RS : foo.rs
24
27
BASE_COMMIT : ${{ github.event.pull_request.base.sha }}
25
28
HEAD_COMMIT : ${{ github.event.pull_request.head.sha }}
29
+ outputs :
30
+ binary-size-reference : ${{ steps.size-reference.outputs.test-binary-size }}
31
+ binary-size-updated : ${{ steps.size-updated.outputs.test-binary-size }}
26
32
steps :
27
33
- name : Print info
28
34
run : |
@@ -77,11 +83,18 @@ jobs:
77
83
main-rs : ${{ env.TEST_MAIN_RS }}
78
84
rustc-dir : ${{ env.RUSTC_DIR }}
79
85
id : size-updated
86
+ report :
87
+ name : Report binary size changes
88
+ runs-on : ubuntu-latest
89
+ needs : measure
90
+ permissions :
91
+ pull-requests : write
92
+ steps :
80
93
- name : Post a PR comment if the size has changed
81
94
uses : actions/github-script@v6
82
95
env :
83
- SIZE_REFERENCE : ${{ steps.size-reference .outputs.test- binary-size }}
84
- SIZE_UPDATED : ${{ steps.size-updated .outputs.test- binary-size }}
96
+ SIZE_REFERENCE : ${{ needs.measure .outputs.binary-size-reference }}
97
+ SIZE_UPDATED : ${{ needs.measure .outputs.binary-size-updated }}
85
98
with :
86
99
script : |
87
100
const reference = process.env.SIZE_REFERENCE;
You can’t perform that action at this time.
0 commit comments