diff --git a/.travis.yml b/.travis.yml index 8022af89..11a3549e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ # This Travis job script has been generated by a script via # -# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--ghc-head' '--no-cabal-check' '--no-no-tests-no-bench' '--no-unconstrained' '--local-ghc-options=-Werror' 'cabal.project' +# haskell-ci '-o' '.travis.yml' '--config=cabal.haskell-ci' 'cabal.project' # # For more information, see https://github.com/haskell-CI/haskell-ci # language: c -sudo: false +dist: xenial git: submodules: false # whether to recursively clone submodules @@ -31,9 +31,6 @@ matrix: - compiler: "ghc-8.6.3" # env: TEST=--disable-tests BENCH=--disable-benchmarks addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}} - - compiler: "ghc-8.6.3" - env: CABALFLAGS="-fembed-data-files" - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}} - compiler: "ghc-8.4.4" # env: TEST=--disable-tests BENCH=--disable-benchmarks addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}} @@ -77,9 +74,7 @@ install: - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - BENCH=${BENCH---enable-benchmarks} - TEST=${TEST---enable-tests} - - HADDOCK=${HADDOCK-true} - UNCONSTRAINED=${UNCONSTRAINED-true} - - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false} - GHCHEAD=${GHCHEAD-false} - travis_retry cabal update -v - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config" @@ -112,7 +107,7 @@ install: - echo 'package criterion-examples' >> cabal.project - "echo ' ghc-options: -Werror' >> cabal.project" - touch cabal.project.local - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- criterion | grep -vw -- criterion-measurement | grep -vw -- criterion-examples | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(criterion|criterion-examples|criterion-measurement)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true - if [ -f "./configure.ac" ]; then @@ -125,7 +120,7 @@ install: (cd "./examples" && autoreconf -i); fi - rm -f cabal.project.freeze - - cabal new-build -w ${HC} ${CABALFLAGS} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all + - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all - rm -rf .ghc.environment.* "."/dist "./criterion-measurement"/dist "./examples"/dist - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) @@ -146,16 +141,23 @@ script: - echo 'package criterion-examples' >> cabal.project - "echo ' ghc-options: -Werror' >> cabal.project" - touch cabal.project.local - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- criterion | grep -vw -- criterion-measurement | grep -vw -- criterion-examples | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(criterion|criterion-examples|criterion-measurement)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true # build & run tests, build benchmarks - - cabal new-build -w ${HC} ${CABALFLAGS} ${TEST} ${BENCH} all - - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${CABALFLAGS} ${TEST} ${BENCH} all; fi + - cabal new-build -w ${HC} ${TEST} ${BENCH} all + - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi # haddock - - if $HADDOCK; then cabal new-haddock -w ${HC} ${CABALFLAGS} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi + - cabal new-haddock -w ${HC} ${TEST} ${BENCH} all + + # Constraint sets + - rm -rf cabal.project.local + + # Constraint set embed-files + - if [ $HCNUMVER -ge 80600 ] && [ $HCNUMVER -lt 80700 ] ; then cabal new-test -w ${HC} --enable-tests --enable-benchmarks --constraint='criterion +embed-data-files' all ; fi + -# REGENDATA ["-o",".travis.yml","--ghc-head","--no-cabal-check","--no-no-tests-no-bench","--no-unconstrained","--local-ghc-options=-Werror","cabal.project"] +# REGENDATA ["-o",".travis.yml","--config=cabal.haskell-ci","cabal.project"] # EOF diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 00000000..a51fd365 --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1,10 @@ +ghc-head: True +cabal-check: False +no-tests-no-benchmarks: False +unconstrained: False +local-ghc-options: -Werror + +constraint-set embed-files + ghc: ==8.6.* + constraints: criterion +embed-data-files + run-tests: True