Skip to content

Commit

Permalink
Add GitHub job for building WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
Dove6 committed Aug 27, 2024
1 parent 5db0d02 commit 6f54937
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always
Expand All @@ -13,20 +13,37 @@ jobs:
test:
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
- name: Build
run: cargo build --all --verbose --features bevy/x11
- name: Run tests
run: cargo test --all --verbose --features bevy/x11
- 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
run: cargo test --all --verbose --features bevy/x11
format:
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
- name: Check formatting
run: cargo fmt --all --check
- name: Check code quality
run: cargo clippy --all --features bevy/x11 -- -Dwarnings
- 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
- name: Set up Rust toolchain
run: rustup component add rust-src --toolchain nightly-2024-08-22-x86_64-unknown-linux-gnu
- 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

0 comments on commit 6f54937

Please sign in to comment.