Skip to content

Commit

Permalink
Add CI for nodejs components (#56)
Browse files Browse the repository at this point in the history
Add CI for nodejs components
  • Loading branch information
tamirms authored Nov 3, 2022
1 parent a6cce45 commit d2dd866
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: NodeJS

on:
push:
branches: [main]
pull_request:

jobs:

build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update
- run: rustup target add wasm32-unknown-unknown
- run: cargo install --target-dir ~/.cargo/target --locked --version 0.1.2 soroban-cli
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: 17.x
cache: 'npm'
- run: npm ci
- run: npm run-script setup
- run: npm run-script build
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ test: fmt

build: fmt
cargo build --target wasm32-unknown-unknown --release
CARGO_TARGET_DIR=target-tiny cargo +nightly build --target wasm32-unknown-unknown --release \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort
cd target/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
wasm-opt -Oz "$$i" -o "$$i.tmp" && mv "$$i.tmp" "$$i"; \
ls -l "$$i"; \
done

build-optimized: fmt
CARGO_TARGET_DIR=target-tiny cargo +nightly build --target wasm32-unknown-unknown --release \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort
cd target-tiny/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
wasm-opt -Oz "$$i" -o "$$i.tmp" && mv "$$i.tmp" "$$i"; \
Expand Down

0 comments on commit d2dd866

Please sign in to comment.