From d2dd86601aa85be863da25617bb11afbfb679590 Mon Sep 17 00:00:00 2001 From: tamirms Date: Thu, 3 Nov 2022 15:30:51 +0000 Subject: [PATCH] Add CI for nodejs components (#56) Add CI for nodejs components --- .github/workflows/nodejs.yml | 25 +++++++++++++++++++++++++ Makefile | 9 +++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..b418bff --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -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 diff --git a/Makefile b/Makefile index 8b4bf2b..6188b4f 100644 --- a/Makefile +++ b/Makefile @@ -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"; \