forked from AssemblyScript/binaryen.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
116 lines (109 loc) · 3.97 KB
/
.travis.yml
File metadata and controls
116 lines (109 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
language: cpp
dist: trusty # limited to 2 cores, max. 4 gb of memory and 20 gb of hard disk space.
compiler: clang
git:
submodules: false
cache:
ccache: true
branches:
only:
- master
env:
global:
- MAKEFLAGS="-j2"
- CFLAGS="-Qunused-arguments -fcolor-diagnostics -fuse-ld=gold"
- CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -fuse-ld=gold"
- CCACHE_SLOPPINESS="pch_defines,time_macros"
- CCACHE_COMPRESS=1
- CCACHE_HARDLINK=1
- CCACHE_MAXSIZE="256m"
- LLVM="$HOME/emscripten-fastcomp/build/bin"
- EMSCRIPTEN_VERSION="incoming"
- EMSCRIPTEN="$HOME/emscripten"
- PATH="$HOME/emscripten:$HOME/cmake/bin:$PATH"
install: # install cmake and node.js
- mkdir $HOME/cmake && wget -qO- https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz | tar -xzC $HOME/cmake --strip-components 1
- nvm install 8
before_script: # setup ccache, git and emscripten
- ccache -z -M $CCACHE_MAXSIZE &&
ccache -s
- git config --global user.email "travis@travis-ci.org" &&
git config --global user.name "Travis CI" &&
git config credential.helper "store --file=.git/credentials" &&
echo "https://${GH_TOKEN}:@github.com" > .git/credentials &&
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > $HOME/.npmrc
- export RC=1
- git clone -b $EMSCRIPTEN_VERSION --depth 1 https://github.com/kripken/emscripten-fastcomp $HOME/emscripten-fastcomp &&
git clone -b $EMSCRIPTEN_VERSION --depth 1 https://github.com/kripken/emscripten-fastcomp-clang $HOME/emscripten-fastcomp/tools/clang &&
git clone -b $EMSCRIPTEN_VERSION --depth 1 https://github.com/kripken/emscripten $HOME/emscripten &&
mkdir $HOME/emscripten-fastcomp/build &&
export CC="ccache clang" &&
export CXX="ccache clang++" &&
export LD="ld.gold" &&
cmake -B$HOME/emscripten-fastcomp/build -H$HOME/emscripten-fastcomp -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;JSBackend" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_INCLUDE_EXAMPLES=OFF -DCLANG_INCLUDE_TESTS=OFF &&
timeout 30m make -C $HOME/emscripten-fastcomp/build $MAKEFLAGS &&
emcc -v &&
emcc -v &&
git checkout master &&
git submodule update --init --remote --merge;
export RC=$?;
$(exit 0)
script: # build binaryen.js
- if [ $RC -eq 0 ]; then
npm install &&
VERSION=`node scripts/version` &&
export VERSION &&
if [[ $VERSION != *nightly* ]]; then
export RELEASE=1 &&
echo "Building release v$VERSION ...";
else
unset RELEASE &&
echo "Building nightly v$VERSION ...";
fi &&
if [ $RELEASE ]; then
TAG=`node scripts/version tag` &&
echo "Resetting to $TAG ..." &&
cd ./binaryen &&
git reset --hard "$TAG" &&
git clean -f &&
cd ..;
fi &&
npm run build &&
npm test;
export RC=$?;
fi;
$(exit $RC)
before_cache: # print ccache statistics
- ccache -s
# --- everything below happens after the cache has been updated ---
after_failure: # trigger continuation if (and only if) the build timed out
- if [ $RC -eq 124 ]; then
git checkout master &&
git pull &&
git commit --allow-empty -m "Build continuation notification" &&
git push -u origin master;
fi
after_success: # push to github and publish on npm (intentionally fails for duplicates, triggers a nightly build when publishing release)
- git add ./binaryen &&
git add ./index.js &&
npm version $VERSION --no-git-tag-version --force &&
if [ $RELEASE ]; then
git add ./package.json &&
git add ./package-lock.json &&
echo "Committing release ("$VERSION") ..." &&
git commit -m "Build ""#"$TRAVIS_BUILD_NUMBER":"" Release v"$VERSION;
else
echo "Committing nightly ("$VERSION") ..." &&
git commit -m "Build ""#"$TRAVIS_BUILD_NUMBER":"" Nightly v"$VERSION" [ci skip]";
fi &&
git push -u origin master &&
echo "Creating tag v$VERSION ..." &&
git tag "v"$VERSION &&
git push -u origin "v"$VERSION &&
if [ $RELEASE ]; then
echo "Publishing release ..." &&
npm publish;
else
echo "Publishing nightly ..." &&
npm publish --tag nightly;
fi