-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
81 lines (69 loc) · 2.04 KB
/
size-cmp.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
---
name: Size Comparison
on:
pull_request:
branches: [master]
paths:
- .github/workflows/size-cmp.yml
- "ci/**"
- "packages/**"
- "examples/**"
- "Cargo.toml"
jobs:
size-cmp:
name: Compare Size between master and current Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
repository: 'yewstack/yew'
ref: master
path: yew-master
- name: Checkout pull request
uses: actions/checkout@v3
with:
path: current-pr
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
components: rust-src
override: true
profile: minimal
- name: Restore Rust cache for master
uses: Swatinem/rust-cache@v1
with:
working-directory: yew-master
key: master
- name: Restore Rust cache for current pull request
uses: Swatinem/rust-cache@v1
with:
working-directory: current-pr
key: pr
- name: Setup Trunk
uses: jetli/trunk-action@v0.1.0
with:
version: 'latest'
- name: Build master examples
run: find ./*/index.html | xargs -I '{}' trunk build --release '{}' || exit 0
working-directory: yew-master/examples
env:
RUSTUP_TOOLCHAIN: nightly
- name: Build pull request examples
run: find ./*/index.html | xargs -I '{}' trunk build --release '{}' || exit 0
working-directory: current-pr/examples
env:
RUSTUP_TOOLCHAIN: nightly
RUSTFLAGS: --cfg nightly_yew
- name: Collect size information
run: python3 current-pr/ci/collect_sizes.py
env:
ISSUE_NUMBER: ${{ github.event.number }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: size-cmp-info
path: ".SIZE_CMP_INFO"
retention-days: 1