Commit 76e3817e authored by Ryan Scott's avatar Ryan Scott

Travis: Enable GHC 8.8.1

parent 4c65964d
...@@ -4,19 +4,17 @@ ...@@ -4,19 +4,17 @@
# #
# For more information, see https://github.com/haskell-CI/haskell-ci # For more information, see https://github.com/haskell-CI/haskell-ci
# #
# version: 0.3 # version: 0.4
# #
language: c language: c
dist: xenial dist: xenial
git: git:
submodules: false # whether to recursively clone submodules # whether to recursively clone submodules
submodules: false
cache: cache:
directories: directories:
- $HOME/.cabal/packages - $HOME/.cabal/packages
- $HOME/.cabal/store - $HOME/.cabal/store
before_cache: before_cache:
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update' # remove files that are regenerated by 'cabal update'
...@@ -25,49 +23,66 @@ before_cache: ...@@ -25,49 +23,66 @@ before_cache:
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
- rm -rfv $CABALHOME/packages/head.hackage - rm -rfv $CABALHOME/packages/head.hackage
matrix: matrix:
include: include:
- compiler: "ghc-8.6.4" - compiler: ghc-8.8.1
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
- compiler: "ghc-8.4.4" - compiler: ghc-8.6.5
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
- compiler: "ghc-8.2.2" - compiler: ghc-8.4.4
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
- compiler: "ghc-8.0.2" - compiler: ghc-8.2.2
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
- compiler: "ghc-7.10.3" - compiler: ghc-8.0.2
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
- compiler: "ghc-7.8.4" - compiler: ghc-7.10.3
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-3.0"]}}
- compiler: "ghc-7.6.3" - compiler: ghc-7.8.4
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-3.0"]}}
- compiler: "ghc-7.4.2" - compiler: ghc-7.6.3
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-3.0"]}}
- compiler: "ghc-7.2.2" - compiler: ghc-7.4.2
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.2.2], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.4.2","cabal-install-3.0"]}}
- compiler: "ghc-7.0.4" - compiler: ghc-7.2.2
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.4], sources: [hvr-ghc]}} addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.2.2","cabal-install-3.0"]}}
- compiler: "ghc-head" - compiler: ghc-7.0.4
env: GHCHEAD=true addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.0.4","cabal-install-3.0"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}} - compiler: ghc-head
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-head","cabal-install-head"]}}
allow_failures: allow_failures:
- compiler: "ghc-head" - compiler: ghc-head
before_install: before_install:
- HC=/opt/ghc/bin/${CC} - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
- HCPKG=${HC/ghc/ghc-pkg} - WITHCOMPILER="-w $HC"
- HCPKG="$HC-pkg"
- unset CC - unset CC
- CABAL=/opt/ghc/bin/cabal - CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal - CABALHOME=$HOME/.cabal
- export PATH="$CABALHOME/bin:$PATH" - export PATH="$CABALHOME/bin:$PATH"
- ROOTDIR=$(pwd) - TOP=$(pwd)
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
- echo $HCNUMVER - echo $HCNUMVER
- CABAL="$CABAL -vnormal+nowrap+markoutput"
- set -o pipefail
- |
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
echo 'BEGIN { state = "output"; }' >> .colorful.awk
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
echo ' if (state == "cabal") {' >> .colorful.awk
echo ' print blue($0)' >> .colorful.awk
echo ' } else {' >> .colorful.awk
echo ' print $0' >> .colorful.awk
echo ' }' >> .colorful.awk
echo '}' >> .colorful.awk
- cat .colorful.awk
- |
color_cabal_output () {
awk -f $TOP/.colorful.awk
}
- echo text | color_cabal_output
install: install:
- ${CABAL} --version - ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
...@@ -75,75 +90,86 @@ install: ...@@ -75,75 +90,86 @@ install:
- if [ $HCNUMVER -lt 70400 ] ; then TEST=--disable-tests ; fi - if [ $HCNUMVER -lt 70400 ] ; then TEST=--disable-tests ; fi
- BENCH=--enable-benchmarks - BENCH=--enable-benchmarks
- if [ $HCNUMVER -lt 70400 ] ; then BENCH=--disable-benchmarks ; fi - if [ $HCNUMVER -lt 70400 ] ; then BENCH=--disable-benchmarks ; fi
- GHCHEAD=${GHCHEAD-false} - HEADHACKAGE=false
- travis_retry ${CABAL} update -v - if [ $HCNUMVER -gt 80801 ] ; then HEADHACKAGE=true ; fi
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config - rm -f $CABALHOME/config
- rm -fv cabal.project cabal.project.local
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
- | - |
if $GHCHEAD; then echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
sed -i 's/-- allow-newer: .*/allow-newer: *:base/' $CABALHOME/config echo "remote-build-reporting: anonymous" >> $CABALHOME/config
for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" $CABALHOME/config; done echo "write-ghc-environment-files: always" >> $CABALHOME/config
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
echo 'repository head.hackage' >> $CABALHOME/config echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
echo ' url: http://head.hackage.haskell.org/' >> $CABALHOME/config echo "world-file: $CABALHOME/world" >> $CABALHOME/config
echo ' secure: True' >> $CABALHOME/config echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> $CABALHOME/config echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> $CABALHOME/config echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> $CABALHOME/config echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
echo ' key-threshold: 3' >> $CABALHOME.config echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
echo "install-dirs user" >> $CABALHOME/config
grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$' echo " prefix: $CABALHOME" >> $CABALHOME/config
echo "repository hackage.haskell.org" >> $CABALHOME/config
${CABAL} new-update head.hackage -v echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
- |
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config
echo "repository head.hackage.ghc.haskell.org" >> $CABALHOME/config
echo " url: https://ghc.gitlab.haskell.org/head.hackage/" >> $CABALHOME/config
echo " secure: True" >> $CABALHOME/config
echo " root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d" >> $CABALHOME/config
echo " 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329" >> $CABALHOME/config
echo " f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89" >> $CABALHOME/config
echo " key-threshold: 3" >> $CABALHOME/config
fi fi
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$' - cat $CABALHOME/config
- rm -f cabal.project - rm -fv cabal.project cabal.project.local cabal.project.freeze
- travis_retry ${CABAL} v2-update -v
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project - touch cabal.project
- "printf 'packages: \".\"\\n' >> cabal.project" - |
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project" echo "packages: ." >> cabal.project
- touch cabal.project.local - |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(hsc2hs)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(hsc2hs)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true - cat cabal.project || true
- cat cabal.project.local || true - cat cabal.project.local || true
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
- rm -f cabal.project.freeze - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" - rm cabal.project.freeze
- rm "cabal.project.freeze" - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- rm -rf .ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script: script:
# test that source-distributions can be generated - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
- ${CABAL} new-sdist all # Packaging...
- ${CABAL} v2-sdist all | color_cabal_output
# Unpacking...
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false - cd ${DISTDIR} || false
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
- rm -f cabal.project - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
- PKGDIR_hsc2hs="$(find . -maxdepth 1 -type d -regex '.*/hsc2hs-[0-9.]*')"
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project - touch cabal.project
- "printf 'packages: \"hsc2hs-*/*.cabal\"\\n' >> cabal.project" - |
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project" echo "packages: ${PKGDIR_hsc2hs}" >> cabal.project
- touch cabal.project.local - |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(hsc2hs)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(hsc2hs)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true - cat cabal.project || true
- cat cabal.project.local || true - cat cabal.project.local || true
# Building...
# this builds all libraries and executables (without tests/benchmarks) # this builds all libraries and executables (without tests/benchmarks)
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
# Building with tests and benchmarks...
# build & run tests, build benchmarks # build & run tests, build benchmarks
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
- if [ $HCNUMVER -ge 70400 ] ; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all ; fi # Testing...
- if [ $HCNUMVER -ge 70400 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
# cabal check # cabal check...
- (cd hsc2hs-* && ${CABAL} check) - (cd ${PKGDIR_hsc2hs} && ${CABAL} -vnormal check)
# Building without installed constraints for packages in global-db...
# Build without installed constraints for packages in global-db - if [ $HCNUMVER -ge 70200 ] ; then rm -f cabal.project.local ; fi
- if [ $HCNUMVER -ge 70200 ] ; then rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all ; fi - if [ $HCNUMVER -ge 70200 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output ; fi
# REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"] # REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"]
# EOF # EOF
...@@ -24,7 +24,7 @@ Description: ...@@ -24,7 +24,7 @@ Description:
Category: Development Category: Development
Data-Files: template-hsc.h Data-Files: template-hsc.h
build-type: Simple build-type: Simple
tested-with: GHC==8.6.4, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 tested-with: GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
extra-source-files: extra-source-files:
changelog.md changelog.md
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment