Skip to content

Commit

Permalink
Merge pull request #37 from freehere107/master
Browse files Browse the repository at this point in the history
Add travis ci
  • Loading branch information
hackfisher authored Jul 8, 2019
2 parents 555b935 + 801992d commit 6b9db28
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Request an environment that provides sudo (that goes with larger containers)
# and a minimal language environment.
sudo: true
language: minimal

cache: cargo

branches:
only:
- master

env:
global:
- RUST_BACKTRACE=1
matrix:
- RUST_TOOLCHAIN=nightly TARGET=wasm
- RUST_TOOLCHAIN=stable TARGET=native

before_install:
# Check how much space we've got on this machine.
- df -h

script:
- ./ci/script.sh

after_script:
# Check how much free disk space left after the build
- df -h
28 changes: 28 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -eux

# Install rustup and the specified rust toolchain.
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$RUST_TOOLCHAIN -y

# Load cargo environment. Specifically, put cargo into PATH.
source ~/.cargo/env

rustc --version
rustup --version
cargo --version

case $TARGET in
"native")
sudo apt-get -y update
sudo apt-get install -y cmake pkg-config libssl-dev

cargo test --all --locked "$@"
;;

"wasm")
# Install prerequisites and build all wasm projects
./init.sh
./build.sh --locked "$@"
;;
esac

0 comments on commit 6b9db28

Please sign in to comment.