Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI production build size summary #401

Merged
merged 18 commits into from
Dec 4, 2023
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 40 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
uses: dtolnay/rust-toolchain@stable

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand All @@ -33,13 +29,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
targets: wasm32-unknown-unknown

- run: rustup target add wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2

- run: cargo install cargo-all-features
Expand All @@ -53,11 +46,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
uses: dtolnay/rust-toolchain@stable

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand All @@ -84,11 +73,8 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt

- uses: Swatinem/rust-cache@v2
Expand All @@ -103,14 +89,45 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
components: clippy

- uses: Swatinem/rust-cache@v2

- name: "clippy --all"
run: cargo clippy --all --features=full --tests -- -D warnings

node-build-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- uses: Swatinem/rust-cache@v2

- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: brotli pv parallel
version: 1.0

- name: Build bundle
run: yarn build
- name: Size Reporting
run: |
ls pkg/*/*.wasm | parallel brotli -f -Z {}
echo "| Asset | Size | Compressed Size |" >> $GITHUB_STEP_SUMMARY
echo "| ------ | ---- | --------------- |" >> $GITHUB_STEP_SUMMARY
for asset in $(ls pkg/*/*.wasm); do
SIZE=$(cat $asset | pv -f -b 2>&1 >/dev/null | tr -d '\n\r')
COMPRESSED_SIZE=$(cat "${asset}.br" | pv -f -b 2>&1 >/dev/null | tr -d '\n\r')
echo "| ${asset} | $SIZE | $COMPRESSED_SIZE |" >> $GITHUB_STEP_SUMMARY
done;