@@ -40,55 +40,51 @@ matrix:
40
40
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
41
41
42
42
before_install :
43
- - HC=${CC}
44
- - HCPKG=${HC/ghc/ghc-pkg}
45
- - unset CC
46
- - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
47
- - PKGNAME='make-travis-yml'
43
+ - HC=${CC}
44
+ - HCPKG=${HC/ghc/ghc-pkg}
45
+ - unset CC
46
+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
48
47
49
48
install :
50
- - cabal --version
51
- - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
52
- - BENCH=${BENCH---enable-benchmarks}
53
- - TEST=${TEST---enable-tests}
54
- - HADDOCK=${HADDOCK-true}
55
- - INSTALLED=${INSTALLED-true}
56
- - travis_retry cabal update -v
57
- - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
58
- - rm -fv cabal.project.local
59
- - " echo 'packages: .' > cabal.project"
60
- - rm -f cabal.project.freeze
61
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
62
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
49
+ - cabal --version
50
+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
51
+ - BENCH=${BENCH---enable-benchmarks}
52
+ - TEST=${TEST---enable-tests}
53
+ - HADDOCK=${HADDOCK-true}
54
+ - INSTALLED=${INSTALLED-true}
55
+ - travis_retry cabal update -v
56
+ - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
57
+ - rm -fv cabal.project.local
58
+ - " echo 'packages: .' > cabal.project"
59
+ - if [ -f "./configure.ac" ]; then
60
+ (cd "."; autoreconf -i);
61
+ fi
62
+ - rm -f cabal.project.freeze
63
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
64
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
65
+ - rm -rf "."/.ghc.environment.* "."/dist
66
+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
63
67
64
68
# Here starts the actual work to be performed for the package under test;
65
69
# any command which exits with a non-zero exit code causes the build to fail.
66
70
script :
67
- - if [ -f configure.ac ]; then autoreconf -i; fi
68
- - rm -rf .ghc.environment.* dist/
69
- - cabal sdist # test that a source-distribution can be generated
70
- - cd dist/
71
- - SRCTAR=(${PKGNAME}-*.tar.gz)
72
- - SRC_BASENAME="${SRCTAR/%.tar.gz}"
73
- - tar -xvf "./$SRC_BASENAME.tar.gz"
74
- - cd "$SRC_BASENAME/"
75
- # # from here on, CWD is inside the extracted source-tarball
76
- - rm -fv cabal.project.local
77
- - " echo 'packages: .' > cabal.project"
78
- # this builds all libraries and executables (without tests/benchmarks)
79
- - rm -f cabal.project.freeze
80
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
81
- # this builds all libraries and executables (including tests/benchmarks)
82
- # - rm -rf ./dist-newstyle
71
+ # test that source-distributions can be generated
72
+ - (cd "."; cabal sdist)
73
+ - mv "."/dist/make-travis-yml-*.tar.gz ${DISTDIR}/
74
+ - cd ${DISTDIR}
75
+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
76
+ - " printf 'packages: make-travis-yml-*/*.cabal\n ' > cabal.project"
77
+ # this builds all libraries and executables (without tests/benchmarks)
78
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
83
79
84
- # Build with installed constraints for packages in global-db
85
- - if $INSTALLED; then
86
- echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
87
- else echo "Not building with installed constraints"; fi
80
+ # Build with installed constraints for packages in global-db
81
+ - if $INSTALLED; then
82
+ echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
83
+ else echo "Not building with installed constraints"; fi
88
84
89
- # build & run tests, build benchmarks
90
- - cabal new-build -w ${HC} ${TEST} ${BENCH} all
91
- - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
85
+ # build & run tests, build benchmarks
86
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
87
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
92
88
93
89
# REGENDATA ["-o",".travis.yml","make-travis-yml.cabal"]
94
90
# EOF
0 commit comments