Skip to content

Commit e27ee4c

Browse files
committed
Regenerate .travis.yml
1 parent 2fa617c commit e27ee4c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# runghc make_travis_yml_2.hs '--branch' 'master' '-o' '.travis.yml' 'github.cabal'
44
#
5-
# For more information, see https://github.com/hvr/multi-ghc-travis
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
77
language: c
88
sudo: false
@@ -64,14 +64,18 @@ install:
6464
- BENCH=${BENCH---enable-benchmarks}
6565
- TEST=${TEST---enable-tests}
6666
- HADDOCK=${HADDOCK-true}
67-
- INSTALLED=${INSTALLED-true}
67+
- UNCONSTRAINED=${UNCONSTRAINED-true}
68+
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
6869
- GHCHEAD=${GHCHEAD-false}
6970
- travis_retry cabal update -v
7071
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
7172
- rm -fv cabal.project cabal.project.local
7273
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
7374
- "printf 'packages: \".\"\\n' > cabal.project"
74-
- cat cabal.project
75+
- touch cabal.project.local
76+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- github | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
77+
- cat cabal.project || true
78+
- cat cabal.project.local || true
7579
- if [ -f "./configure.ac" ]; then
7680
(cd "." && autoreconf -i);
7781
fi
@@ -90,13 +94,13 @@ script:
9094
- cd ${DISTDIR} || false
9195
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
9296
- "printf 'packages: github-*/*.cabal\\n' > cabal.project"
93-
- cat cabal.project
97+
- touch cabal.project.local
98+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- github | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
99+
- cat cabal.project || true
100+
- cat cabal.project.local || true
94101
# this builds all libraries and executables (without tests/benchmarks)
95102
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
96103

97-
# Build with installed constraints for packages in global-db
98-
- if $INSTALLED; then 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; else echo "Not building with installed constraints"; fi
99-
100104
# build & run tests, build benchmarks
101105
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
102106
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
@@ -108,5 +112,8 @@ script:
108112
- rm -rf ./dist-newstyle
109113
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
110114

115+
# Build without installed constraints for packages in global-db
116+
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
117+
111118
# REGENDATA ["--branch","master","-o",".travis.yml","github.cabal"]
112119
# EOF

0 commit comments

Comments
 (0)