diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2018-02-02 17:40:52 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2018-02-02 17:40:52 +0100 |
commit | d43eb49474de826039594a8c78bcf70fb196ea19 (patch) | |
tree | 80d059ce6b428505fa3aeda4564194566b456ece | |
parent | 8797304592eb909daef4e4b8e973a509d8d567f9 (diff) |
use stack instead of docker on travis ci
-rw-r--r-- | .travis.yml | 42 | ||||
-rwxr-xr-x | run-test-suite.sh | 18 |
2 files changed, 41 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml index 81c559db..05b93ab0 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -1,15 +1,39 @@ | |||
1 | sudo: false | ||
2 | dist: trusty | ||
3 | language: generic | ||
1 | 4 | ||
2 | language: c | 5 | env: |
6 | global: | ||
7 | - GCC=gcc-5 | ||
8 | - GXX=g++-5 | ||
3 | 9 | ||
4 | sudo: required | 10 | cache: |
5 | services: | 11 | directories: |
6 | - docker | 12 | - $HOME/.stack/ |
13 | |||
14 | addons: | ||
15 | apt: | ||
16 | packages: | ||
17 | - gcc-5 | ||
18 | - g++-5 | ||
19 | - libgmp-dev | ||
20 | - llvm-5.0-dev | ||
21 | sources: | ||
22 | - llvm-toolchain-trusty-5.0 | ||
23 | - ubuntu-toolchain-r-test | ||
7 | 24 | ||
8 | before_install: | 25 | before_install: |
9 | - grep '\(MemTotal\|SwapTotal\)' /proc/meminfo | 26 | - mkdir -p ~/.local/bin |
10 | - git show | head -1 # (for matching against commit hash given on the travis log web page) | 27 | - export PATH=~/.local/bin:$PATH |
11 | - docker pull lambdacube3d/lambdacube3d | 28 | - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' |
12 | - docker run --rm -it -v `pwd`:/root/source/lambdacube-compiler lambdacube3d/lambdacube3d /bin/sh -c "ghc-pkg list" | 29 | - export CC=/usr/bin/$GCC |
30 | - export CXX=/usr/bin/$GXX | ||
31 | |||
32 | install: | ||
33 | - stack update | ||
34 | - stack --no-terminal --install-ghc test --only-dependencies | ||
35 | - stack install | ||
13 | 36 | ||
14 | script: | 37 | script: |
15 | - docker run --rm -it -v `pwd`:/root/source/lambdacube-compiler lambdacube3d/lambdacube3d /bin/sh -c "/root/source/lambdacube-compiler/travis/build.sh && /root/source/lambdacube-compiler/travis/profile.sh" | 38 | - travis/build.sh |
39 | - travis/profile.sh | ||
diff --git a/run-test-suite.sh b/run-test-suite.sh index d2173427..996e7d6d 100755 --- a/run-test-suite.sh +++ b/run-test-suite.sh | |||
@@ -4,29 +4,27 @@ UNIT_TEST_PARAMS="--quickcheck-max-size 30 --quickcheck-tests 100" | |||
4 | 4 | ||
5 | if [ "$1" == "--profile" ] ; then | 5 | if [ "$1" == "--profile" ] ; then |
6 | shift | 6 | shift |
7 | cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling | 7 | stack build --profile --flag lambdacube-compiler:testsuite --flag lambdacube-compiler:profiling --flag lambdacube-compiler:-cli |
8 | cabal configure --flags "profiling testsuite -cli" --enable-library-profiling --enable-executable-profiling | ||
9 | set +e | 8 | set +e |
10 | RESULT_UNITTESTS=0 | 9 | RESULT_UNITTESTS=0 |
11 | cabal run lambdacube-compiler-test-suite -- -r -iperformance -i.ignore $@ +RTS -p | 10 | stack exec lambdacube-compiler-test-suite -- -r -iperformance -i.ignore $@ +RTS -p |
12 | RESULT_TESTS=`echo $?` | 11 | RESULT_TESTS=`echo $?` |
13 | elif [ "$1" == "--coverage" ] ; then | 12 | elif [ "$1" == "--coverage" ] ; then |
14 | shift | 13 | shift |
15 | set +e | 14 | set +e |
16 | cabal install --only-dependencies | 15 | stack build --flag lambdacube-compiler:coverage --flag lambdacube-compiler:alltest |
17 | cabal configure --flags "coverage alltest" | 16 | stack exec lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS |
18 | cabal run lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS | ||
19 | RESULT_UNITTESTS=`echo $?` | 17 | RESULT_UNITTESTS=`echo $?` |
20 | cabal run lambdacube-compiler-coverage-test-suite -- -iperformance -i.ignore -r $@ | 18 | stack exec lambdacube-compiler-coverage-test-suite -- -iperformance -i.ignore -r $@ |
21 | RESULT_TESTS=`echo $?` | 19 | RESULT_TESTS=`echo $?` |
22 | ./create-test-report.sh | 20 | ./create-test-report.sh |
23 | rm lambdacube-compiler-coverage-test-suite.tix | 21 | rm lambdacube-compiler-coverage-test-suite.tix |
24 | else | 22 | else |
25 | set +e | 23 | set +e |
26 | cabal install --only-dependencies -j1 | 24 | stack build --flag lambdacube-compiler:alltest |
27 | cabal run lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS | 25 | stack exec lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS |
28 | RESULT_UNITTESTS=`echo $?` | 26 | RESULT_UNITTESTS=`echo $?` |
29 | cabal run lambdacube-compiler-test-suite -- -iperformance -i.ignore -r $@ | 27 | stack exec lambdacube-compiler-test-suite -- -iperformance -i.ignore -r $@ |
30 | RESULT_TESTS=`echo $?` | 28 | RESULT_TESTS=`echo $?` |
31 | fi | 29 | fi |
32 | 30 | ||