forked from charlescrain/hs-web3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (50 loc) · 2.88 KB
/
.travis.yml
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
sudo: required
language: haskell
services:
- docker
before_install:
- nvm install 8.9.4
- nvm use 8.9.4
- npm i -g purescript@0.11.7 bower pulp
- if [ $STACK ]; then mkdir -p ~/.local/bin; export PATH=$HOME/.local/bin:$PATH;
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack';
else export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH;
fi
install:
- $STACK || if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; then zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz
> $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; ls -l $HOME/.cabal/packages/hackage.haskell.org/;
fi; cabal update; sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config; if [ -n "$CABALCONFIG"
]; then cp $CABALCONFIG cabal.config; fi; if [ -n "$STACKAGESNAPSHOT" ]; then curl
--silent https://www.stackage.org/$STACKAGESNAPSHOT/cabal.config | grep -v "$(cabal
info . -v0 | head -n 1 | awk '{ print $2 }' | sed -E 's/-[0-9]+(\.[0-9]+)+//') =="
> cabal.config; fi; cabal install --only-dependencies --enable-tests $CABALCONFOPTS --dry -v >
installplan.txt; sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt;
if diff -u $HOME/.cabsnap/installplan.txt installplan.txt; then echo "cabal build-cache
HIT"; rm -rfv .ghc; cp -av $HOME/.cabsnap/ghc $HOME/.ghc; cp -av $HOME/.cabsnap/lib
$HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; else echo "cabal build-cache
MISS"; rm -rf $HOME/.cabsnap; mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share
$HOME/.cabal/bin; cabal install --only-dependencies --enable-tests $CABALCONFOPTS; fi; if [ ! -d
$HOME/.cabsnap ]; then echo "snapshotting package-db to build-cache"; mkdir $HOME/.cabsnap;
cp -av $HOME/.ghc $HOME/.cabsnap/ghc; cp -av $HOME/.cabal/lib $HOME/.cabal/share
$HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; fi;
script:
- docker run --rm -d -p 8545:8545 foamspace/cliquebait:latest && sleep 15
- cd test-support && make install && make compile-contracts && make deploy && cd ..
- if [ $STACK ]; then stack -j2 --no-terminal --install-ghc test --test-arguments="--skip=multiEvent";
else cabal update && cabal install --only-dependencies --enable-tests $CABALCONFOPTS && cabal configure --enable-tests $CABALCONFOPTS -v2 && cabal build web3 $CABALBUILDOPTS && cabal test --test-option="--skip=multiEvent";
fi
matrix:
include:
# - env: GHCVER=8.2.2 CABALVER=2.0
# addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
# - env: GHCVER=8.4.2 CABALVER=2.2
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.2], sources: [hvr-ghc]}}
- env: STACK=YES
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
cache:
directories:
- $HOME/.stack
- $HOME/.cabsnap
- $HOME/.cabal/packages