forked from paritytech/polkadot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
389 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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_success: | ||
- if [ "$TARGET" == "wasm" ] && [ "$TRAVIS_PULL_REQUEST" != "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then | ||
./ci/publish-wasm.sh; | ||
fi | ||
|
||
after_script: | ||
# Check how much free disk space left after the build | ||
- df -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Publish wasm binaries into the special repository. | ||
# This script assumes that wasm binaries have already been built. | ||
# Requires GH_TOKEN environment variable to be defined. | ||
|
||
set -e | ||
|
||
source ./common.sh | ||
|
||
if [ -z ${GH_TOKEN+x} ]; then | ||
echo "GH_TOKEN environment variable is not set" | ||
exit 1 | ||
fi | ||
|
||
REPO="github.com/paritytech/polkadot-wasm-bin.git" | ||
REPO_AUTH="${GH_TOKEN}:@${REPO}" | ||
DST=".wasm-binaries" | ||
TARGET="wasm32-unknown-unknown" | ||
UTCDATE=`date -u "+%Y%m%d.%H%M%S.0"` | ||
|
||
pushd . | ||
|
||
echo "*** Cloning repo" | ||
rm -rf $DST | ||
git clone https://$REPO $DST | ||
cd $DST | ||
rm -rf $TARGET | ||
mkdir -p $TARGET | ||
|
||
echo "*** Setting up GH config" | ||
git config push.default simple | ||
git config merge.ours.driver true | ||
git config user.email "[email protected]" | ||
git config user.name "CI Build" | ||
git remote set-url origin https://$REPO_AUTH > /dev/null 2>&1 | ||
|
||
for SRC in "${SRCS[@]}" | ||
do | ||
echo "*** Copying wasm binaries from $SRC" | ||
cp ../$SRC/target/$TARGET/release/*.wasm $TARGET | ||
done | ||
|
||
if [ -f "package.json" ]; then | ||
echo "*** Updating package.json" | ||
sed -i -e "s/\"version\": \"[0-9.]*\"/\"version\": \"$UTCDATE\"/g" package.json | ||
rm -rf package.json.bak | ||
fi | ||
|
||
echo "*** Adding to git" | ||
echo "$UTCDATE" > README.md | ||
git add --all . | ||
git commit -m "$UTCDATE" | ||
|
||
echo "*** Pushing upstream" | ||
git push --quiet origin HEAD:refs/heads/master > /dev/null 2>&1 | ||
|
||
echo "*** Cleanup" | ||
cd .. | ||
rm -rf $DST | ||
popd | ||
|
||
echo "*** Completed" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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 | ||
./scripts/init.sh | ||
./scripts/build.sh | ||
./scripts/build-demos.sh | ||
;; | ||
esac |
Oops, something went wrong.