forked from linebender/glazier
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (76 loc) · 2.79 KB
/
bloat.yml
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
on:
issue_comment:
types: [created, edited]
name: bloat check
jobs:
bloat_check:
runs-on: macOS-latest
name: post binary size change info
# if it isn't an issue comment run every time, otherwise only run if the comment starts with '/bloat'
if: (!startsWith(github.event_name, 'issue_comment') || startsWith(github.event.comment.body, '/bloat'))
steps:
- name: checkout
uses: actions/checkout@v3
- name: get revisions
id: get_revs
uses: cmyr/bloat-cmp/get-revs@v2
with:
command: /bloat
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: fetch refs
run: git fetch origin ${{ steps.get_revs.outputs.fetch }}
if: steps.get_revs.outputs.fetch != ''
- name: checkout base
uses: actions/checkout@v3
with:
ref: ${{ steps.get_revs.outputs.base }}
- name: setup stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "stable"
- name: build base
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
run: cargo build --release --examples
- name: get old sizes
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
id: old
uses: cmyr/bloat-cmp/get-sizes@v2
with:
paths: >
target/release/examples/edit_text.rs
target/release/examples/invalidate.rs
target/release/examples/perftest.rs
target/release/examples/quit.rs
target/release/examples/shello.rs
- name: checkout head
uses: actions/checkout@v3
with:
clean: false # avoid rebuilding artifacts unnecessarily
ref: ${{ steps.get_revs.outputs.head }}
- name: build head
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
run: cargo build --release --examples
- name: get new sizes
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
id: new
uses: cmyr/bloat-cmp/get-sizes@v2
with:
paths: >
target/release/examples/edit_text.rs
target/release/examples/invalidate.rs
target/release/examples/perftest.rs
target/release/examples/quit.rs
target/release/examples/shello.rs
- name: compare
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
id: bloatcmp
uses: cmyr/bloat-cmp/compare@v2
with:
old: ${{ steps.old.outputs.rawSizes }}
new: ${{ steps.new.outputs.rawSizes }}
- name: comment
if: steps.get_revs.outputs.base != steps.get_revs.outputs.head
uses: cmyr/bloat-cmp/post-comment@v2
with:
stats: ${{ steps.bloatcmp.outputs.stats }}
myToken: ${{ secrets.GITHUB_TOKEN }}