Skip to content

Better CI workflow.

Better CI workflow. #9

Workflow file for this run

name: Build Wirdigen
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Check formatting Wirdigen CLI
uses: actions-rust-lang/rustfmt@v1
with:
manifest-path: './Cargo.toml'
- name: Check formatting Wirdigen WASM
uses: actions-rust-lang/rustfmt@v1
with:
manifest-path: './wasm/Cargo.toml'
wirdigen_cli:
name: Wirdigen CLI
needs: formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Check sources
run: cargo check --release
- name: Run clippy
run: cargo clippy
- name: Build sources
run: cargo build --release
- name: Run tests
run: cargo test --release
wirdigen_wasm:
name: Wirdigen WASM
needs: formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build sources
run: wasm-pack build wasm -t nodejs --out-name wirdigen_wasm --target-dir target
- name: Pack NPM package
run: wasm-pack pack wasm