Skip to content

Commit

Permalink
Merge pull request #19 from coilysiren/js
Browse files Browse the repository at this point in the history
Javascript build
  • Loading branch information
coilysiren committed Nov 24, 2023
2 parents 06a887e + efe4f22 commit c365ca6
Show file tree
Hide file tree
Showing 14 changed files with 4,626 additions and 6,808 deletions.
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

0 comments on commit c365ca6

Please sign in to comment.