-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
73 lines (62 loc) · 1.9 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
name: Size Comparison
on:
pull_request:
branches: [master]
paths:
- .github/workflows/size-cmp.yml
- "ci/**"
- "packages/**"
- "examples/**"
- "Cargo.toml"
jobs:
size-cmp:
name: Collect ${{ matrix.target }} Size
runs-on: ubuntu-latest
strategy:
matrix:
target: ["master", "pr"]
steps:
- name: Checkout master
uses: actions/checkout@v4
if: ${{ matrix.target == 'master' }}
with:
repository: "yewstack/yew"
ref: master
- name: Checkout pull request
uses: actions/checkout@v4
if: ${{ matrix.target == 'pr' }}
- name: Write Optimisation Flags
run: |
echo 'share-generics = true' >> .cargo/config.toml
echo 'build-std = ["std", "panic_abort"]' >> .cargo/config.toml
echo 'build-std-features = ["panic_immediate_abort"]' >> .cargo/config.toml
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
targets: wasm32-unknown-unknown
- name: Restore Rust cache for master
uses: Swatinem/rust-cache@v2
with:
shared-key: size-compare
- name: Setup Trunk
uses: jetli/[email protected]
with:
version: "latest"
- name: Build examples
run: find ./*/index.html | xargs -I '{}' trunk build --release '{}' || exit 0
working-directory: examples
env:
RUSTUP_TOOLCHAIN: nightly
RUSTFLAGS: --cfg nightly_yew
- name: Collect size information
run: python3 ci/collect_sizes.py
env:
ISSUE_NUMBER: ${{ github.event.number }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: size-cmp-${{ matrix.target }}-info
path: ".SIZE_CMP_INFO"
retention-days: 1