Add convenience script to run most ci checks locally

This commit is contained in:
Hendrik Eeckhaut
2024-10-02 11:40:50 +02:00
parent 6b845fd473
commit 99e02fb388
2 changed files with 30 additions and 3 deletions

View File

@@ -1,4 +1,9 @@
#!/bin/sh
# Ensure the script runs in the folder that contains this script
cd "$(dirname "$0")"
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \
rustup run nightly \
wasm-pack build ../wasm --target web --no-pack --out-dir=../wasm-test-runner/static/generated -- -Zbuild-std=panic_abort,std --features test,no-bundler \
&& RUST_LOG=debug cargo run --release
rustup run nightly \
wasm-pack build ../wasm --target web --no-pack --out-dir=../wasm-test-runner/static/generated -- -Zbuild-std=panic_abort,std --features test,no-bundler &&
RUST_LOG=debug cargo run --release

22
pre-commit-check.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
# This script is used to run checks before committing changes to the repository.
# It is a good approximation of what CI will do.
# Fail if any command fails
set -e
# Check formatting
cargo +nightly fmt --all
# Check clippy
cargo clippy --all-features --all-targets -- -D warnings
# Build all targets
# cargo build --all-targets
# Run tests
# cargo test
# Run wasm tests
# ./crates/wasm-test-runner/run.sh