Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript build #19

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ on:
- main

jobs:
test:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: curl -sSf https://sh.rustup.rs | sh -s -- -y

# rust
- run: cargo build
- run: cargo check
- run: cargo test
- run: pip install tomlq

# wasm
- run: cargo install wasm-pack
- run: wasm-pack build --target web
js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: curl -sSf https://sh.rustup.rs | sh -s -- -y
- run: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

# wasm
- run: cargo install wasm-pack
- run: wasm-pack build --target web

# js
- run: npm ci
12 changes: 3 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/target
**/*.rs.bk
node_modules

# the following entries are removed from this file on the deploy branch
dist/
pkg/
*.wasm
*.log
wasm-pack.log
target/
node_modules/
27 changes: 0 additions & 27 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,14 @@
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'

update:
brew upgrade
brew update
rustup self update
rustup update
rm Cargo.lock
cargo update
npm i -g npm

install:
cargo build
npm install

dev: ## dev (primary entrypoint)
npx concurrently \
-k -n rust,rust::test,js,js::test \
-c red,red,green,green \
"make build-rust-dev" \
"make test-rust-dev" \
"make build-js-dev" \
"make test-js-dev"

test-rust:
cargo check
cargo test -- --color always

test-rust-dev:
cargo watch -s "make test-rust"

test-js:
npx karma start src/js/tests/karma.conf.js --singleRun=true

test-js-dev:
npx karma start src/js/tests/karma.conf.js

build-rust:
cargo build
make build-wasm
Expand Down
Loading