Improve dev env & CI setup
This commit is contained in:
parent
27ad42de2b
commit
38b39101ce
6 changed files with 24 additions and 32 deletions
29
.github/workflows/check.yml
vendored
29
.github/workflows/check.yml
vendored
|
|
@ -37,20 +37,8 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
- name: Setup rust
|
|
||||||
run: |
|
|
||||||
which wasm-pack || cargo install wasm-pack
|
|
||||||
which cargo-machete || cargo install cargo-machete
|
|
||||||
|
|
||||||
- name: Build wasm
|
|
||||||
run: |
|
|
||||||
wasm-pack build --target web --features wasm
|
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: scripts/lint.sh
|
||||||
cargo clippy --all-targets --all-features
|
|
||||||
cargo fmt --all -- --check
|
|
||||||
cargo machete
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: scripts/test.sh
|
run: scripts/test.sh
|
||||||
|
|
@ -117,19 +105,8 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-npm-
|
||||||
|
|
||||||
- name: Setup rust
|
- name: Build website
|
||||||
run: |
|
run: scripts/build-website.sh
|
||||||
which wasm-pack || cargo install wasm-pack
|
|
||||||
|
|
||||||
- name: Build wasm
|
|
||||||
run: |
|
|
||||||
wasm-pack build --target web --features wasm
|
|
||||||
|
|
||||||
- name: Build reconcile-js
|
|
||||||
run: |
|
|
||||||
cd reconcile-js
|
|
||||||
npm ci
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: Publish reconcile-js to NPM
|
- name: Publish reconcile-js to NPM
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -125,14 +125,10 @@ Contributions are welcome!
|
||||||
|
|
||||||
#### Rust toolchain
|
#### Rust toolchain
|
||||||
|
|
||||||
1. Install [rustup](https://rustup.rs):
|
Install [rustup](https://rustup.rs):
|
||||||
```bash
|
```bash
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
```
|
```
|
||||||
2. Install additional tools:
|
|
||||||
```bash
|
|
||||||
cargo install wasm-pack cargo-insta cargo-edit
|
|
||||||
```
|
|
||||||
|
|
||||||
### Scripts
|
### Scripts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
which wasm-pack || cargo install wasm-pack
|
||||||
wasm-pack build --target web --features wasm
|
wasm-pack build --target web --features wasm
|
||||||
|
|
||||||
cd reconcile-js
|
cd reconcile-js
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Bumping versions"
|
echo "Bumping versions"
|
||||||
|
|
||||||
|
which cargo-set-version || cargo install cargo-edit
|
||||||
cargo set-version --bump $1
|
cargo set-version --bump $1
|
||||||
|
|
||||||
|
which wasm-pack || cargo install wasm-pack
|
||||||
|
|
||||||
wasm-pack build --target web --features wasm
|
wasm-pack build --target web --features wasm
|
||||||
|
|
||||||
cd reconcile-js
|
cd reconcile-js
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
which cargo-machete || cargo install cargo-machete
|
||||||
|
cargo machete
|
||||||
|
|
||||||
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
|
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
|
||||||
cargo fmt --all
|
cargo fmt --all
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
which cargo-insta || cargo install cargo-insta
|
||||||
|
which wasm-pack || cargo install wasm-pack
|
||||||
|
|
||||||
|
node_version=$(node --version | cut -d'.' -f1 | tr -d 'v')
|
||||||
|
if [ "$node_version" != "22" ]; then
|
||||||
|
echo "Error: Node.js version 22 is required, but found version $node_version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
wasm-pack build --target web --features wasm,console_error_panic_hook
|
wasm-pack build --target web --features wasm,console_error_panic_hook
|
||||||
cargo test --verbose --features serde -- --include-ignored
|
cargo test --verbose --features serde -- --include-ignored
|
||||||
|
|
||||||
|
|
@ -13,7 +22,8 @@ cargo test --features all
|
||||||
wasm-pack test --node --features wasm,console_error_panic_hook
|
wasm-pack test --node --features wasm,console_error_panic_hook
|
||||||
|
|
||||||
cd reconcile-js
|
cd reconcile-js
|
||||||
npm install
|
npm ci
|
||||||
|
npm run build
|
||||||
npm run test
|
npm run test
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue