Skip to content

Commit

Permalink
Regenerate .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Feb 11, 2019
1 parent cfaab9e commit 5fcae6b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]}}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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
10 changes: 10 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5fcae6b

Please sign in to comment.