From e1134ab3f8241c1b7afa1d83a9fa51b7165138f0 Mon Sep 17 00:00:00 2001 From: Dove6 <24943032+Dove6@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:23:42 +0200 Subject: [PATCH] Add GitHub job for building WASM --- .github/workflows/rust.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d3a23ec..02da7ee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,6 +16,7 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 + - uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --all --verbose --features bevy/x11 - name: Run tests @@ -26,7 +27,21 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 + - uses: Swatinem/rust-cache@v2 - name: Check formatting run: cargo fmt --all --check - name: Check code quality run: cargo clippy --all --features bevy/x11 -- -Dwarnings + web: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 + - uses: Swatinem/rust-cache@v2 + - name: Build debug + run: cargo build --target wasm32-unknown-unknown --all --verbose -Zbuild-std=std,panic_abort + - name: Generate files for debug + run: wasm-bindgen --no-typescript --target web --out-dir ./out_debug/ --out-name "pixlib" ./target/wasm32-unknown-unknown/debug/pixlib.wasm + - name: Summarize size of out dir for debug + run: du -sh ./out_debug