Skip to content
Permalink
Browse files

Deploy to gh-pages with Travis CI (#1)

  • Loading branch information...
marcomontalbano committed Feb 21, 2019
1 parent 71c3752 commit 0d29e0d35fe4f69cb8e24d9a2df59b15b6538258
Showing with 39 additions and 1 deletion.
  1. +30 −0 .travis.yml
  2. +7 −1 README.md
  3. +2 −0 package.json
@@ -0,0 +1,30 @@
language: node_js

# cache:
# directories:
# - $HOME/.cargo
# - $TRAVIS_BUILD_DIR/target

node_js:
- "8"

before_install:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source $HOME/.cargo/env

stages:
- test
- name: deploy
if: (NOT type IN (pull_request)) AND (branch = master)

jobs:
include:
- stage: test
script:
- npm test
- stage: deploy
before_script:
- cargo install wasm-pack
script:
- npm run build
- npm run publish
@@ -1,12 +1,15 @@
# WebAssembly vs Javascript

[![Build Status](https://travis-ci.org/marcomontalbano/wa-vs-js-benchmark.svg?branch=master)](https://travis-ci.org/marcomontalbano/wa-vs-js-benchmark)

*A comparison between WebAssembly and Javascript made for ~~studying~~ fun.*

## What's in the box

- WebAssembly with Rust
- Benchmark with fancy charts
- Web Workers to avoid a frozen main thread
- Build and deploy with Travis CI

## Rust and WebAssembly

@@ -15,7 +18,7 @@ There are two books that fully cover this section:
- https://doc.rust-lang.org/book
- https://rustwasm.github.io/book

In this project I'm also using [`wasm-bingen`](https://rustwasm.github.io/wasm-bindgen). This is a tool that facilitates high-level interactions between wasm modules and JavaScript.
In this project I'm also using [`wasm-bingen`](https://rustwasm.github.io/wasm-bindgen) and [`wasm-pack`](https://github.com/rustwasm/wasm-pack).

## Project

@@ -60,6 +63,9 @@ Runnig following command we'll install Rust and [Cargo](https://doc.rust-lang.or

```sh
$ curl https://sh.rustup.rs -sSf | sh
# install `wasm-pack`
$ cargo install wasm-pack
```

Now we are able to use the following commands from our project folder.
@@ -11,6 +11,8 @@
"scripts": {
"start": "webpack-dev-server --mode=development",
"start:dist": "npx serve dist",
"test:rs": "cargo build --verbose && cargo test --verbose",
"test": "npm run test:rs",
"build:wasm": "wasm-pack build",
"build:rs": "cargo build --release",
"build:js": "webpack --mode=production --config webpack.config.js",

0 comments on commit 0d29e0d

Please sign in to comment.
You can’t perform that action at this time.