Skip to content

Commit

Permalink
Add handy scripts (bytecodealliance#30)
Browse files Browse the repository at this point in the history
* Extract test.sh and doc.sh from .travis.yml

* check.sh
  • Loading branch information
pepyakin authored and NikVolf committed Jan 31, 2018
1 parent 551c992 commit 3ad9f07
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ install:
script:
- export CC=/usr/bin/gcc-6
- export CXX=/usr/bin/g++-6
- cargo test --verbose
- cargo test --manifest-path=spec/Cargo.toml
# cargo-deadlinks will check any links in docs generated by `cargo doc`.
# This is useful as rustdoc uses raw links which is error prone.
- cargo doc && cargo deadlinks
- ./test.sh
- ./doc.sh
after_success: |
# Build documentation and deploy it to github pages.
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html &&
sudo pip install ghp-import &&
ghp-import -n target/doc &&
Expand Down
12 changes: 12 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -eux

cd $(dirname $0)

cargo check --tests
cargo check \
--manifest-path=spec/Cargo.toml \
--tests

cd -
14 changes: 14 additions & 0 deletions doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -eux

cd $(dirname $0)

cargo doc

# cargo-deadlinks will check any links in docs generated by `cargo doc`.
# This is useful as rustdoc uses raw links which are error prone.
command -v cargo-deadlinks &> /dev/null &&
cargo deadlinks

cd -
10 changes: 10 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -eux

cd $(dirname $0)

time cargo test
time cargo test --manifest-path=spec/Cargo.toml

cd -

0 comments on commit 3ad9f07

Please sign in to comment.