Skip to content

Commit

Permalink
Upgrade multi-ghc-travis setup
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Jan 18, 2018
1 parent 6508a04 commit 2e0a731
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 39 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
dist-newstyle
docs
wiki
TAGS
Expand All @@ -11,3 +12,22 @@ wip
*.hi
*~
*#
.stack-work/
.stack-work/
cabal-dev
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
176 changes: 141 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,151 @@
env:
- GHCVER=7.0.2 CABALVER=1.24
- GHCVER=7.2.2 CABALVER=1.24
- GHCVER=7.4.2 CABALVER=1.16
- GHCVER=7.6.3 CABALVER=1.16
- GHCVER=7.8.4 CABALVER=1.18
- GHCVER=7.10.1 CABALVER=1.22
- GHCVER=8.0.1 CABALVER=1.24
- GHCVER=head CABALVER=head
# This Travis job script has been generated by a script via
#
# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-installed' 'cabal.project'
#
# For more information, see https://github.com/hvr/multi-ghc-travis
#
language: c
sudo: false

git:
submodules: false # whether to recursively clone submodules

notifications:
irc:
channels:
- "irc.freenode.org#haskell-lens"
skip_join: true
template:
- "\x0313reflection\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"

cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store

before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx

- rm -rfv $HOME/.cabal/packages/head.hackage

matrix:
include:
- compiler: "ghc-7.0.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.0.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.2.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.2.2], sources: [hvr-ghc]}}
- compiler: "ghc-7.4.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.4.2], sources: [hvr-ghc]}}
- compiler: "ghc-7.6.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.6.3], sources: [hvr-ghc]}}
- compiler: "ghc-7.8.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.8.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-8.0.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.2.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.4.1"
env: GHCHEAD=true
addons: {apt: {packages: [*apt_packages,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
- compiler: "ghc-head"
env: GHCHEAD=true
addons: {apt: {packages: [*apt_packages,cabal-install-head,ghc-head], sources: [hvr-ghc]}}

allow_failures:
- env: GHCVER=head CABALVER=head
- compiler: "ghc-7.0.4"
- compiler: "ghc-7.2.2"
- compiler: "ghc-8.4.1"
- compiler: "ghc-head"

before_install:
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- cabal --version
- HC=${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
- ROOTDIR=$(pwd)
- mkdir -p $HOME/.local/bin
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
- echo $HCNUMVER

install:
- travis_retry cabal update
- cabal install --enable-tests --only-dependencies
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks}
- TEST=${TEST---enable-tests}
- HADDOCK=${HADDOCK-true}
- INSTALLED=${INSTALLED-true}
- GHCHEAD=${GHCHEAD-false}
- travis_retry cabal update -v
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
- rm -fv cabal.project cabal.project.local
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
- |
if $GHCHEAD; then
sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
echo 'repository head.hackage' >> ${HOME}/.cabal/config
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
echo ' secure: True' >> ${HOME}/.cabal/config
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
cabal new-update head.hackage -v
fi
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
- "printf 'packages: \".\" \"./examples\"\\n' > cabal.project"
- cat cabal.project
- if [ -f "./configure.ac" ]; then
(cd "." && autoreconf -i);
fi
- if [ -f "./examples/configure.ac" ]; then
(cd "./examples" && autoreconf -i);
fi
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- rm -rf "."/.ghc.environment.* "./examples"/.ghc.environment.* "."/dist "./examples"/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:
- cabal configure -v2 --enable-tests
- cabal build
- cabal sdist
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
cd dist/;
if [ -f "$SRC_TGZ" ]; then
cabal install "$SRC_TGZ";
else
echo "expected '$SRC_TGZ' not found";
exit 1;
fi
# test that source-distributions can be generated
- (cd "." && cabal sdist)
- (cd "./examples" && cabal sdist)
- mv "."/dist/reflection-*.tar.gz "./examples"/dist/reflection-examples-*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: reflection-*/*.cabal reflection-examples-*/*.cabal\\n' > cabal.project"
- cat cabal.project

notifications:
irc:
channels:
- "irc.freenode.org#haskell-lens"
skip_join: true
template:
- "\x0313reflection\x0f/\x0306%{branch}\x0f \x0314%{commit}\x0f %{message} \x0302\x1f%{build_url}\x0f"

# build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all

# cabal check
- (cd reflection-* && cabal check)
- (cd reflection-examples-* && cabal check)

# haddock
- rm -rf ./dist-newstyle
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi

# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-installed","cabal.project"]
# EOF
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: .
./examples
2 changes: 2 additions & 0 deletions examples/Constraints.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE Rank2Types, TypeFamilies, TypeOperators, ConstraintKinds, PolyKinds, FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, FlexibleContexts, UndecidableInstances #-}
module Constraints where

import Control.Newtype -- from newtype
import Data.Constraint -- from constraints
import Data.Constraint.Unsafe -- from constraints
Expand Down
31 changes: 31 additions & 0 deletions examples/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Copyright (c) 2009-2013 Edward Kmett
Copyright (c) 2004 Oleg Kiselyov and Chung-chieh Shan
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Edward Kmett nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 2 additions & 0 deletions examples/Monoid.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE CPP, Rank2Types, FlexibleContexts, UndecidableInstances #-}
module Monoid where

import Data.Reflection -- from reflection
import Data.Semigroup -- from base
import Data.Proxy -- from tagged
Expand Down
70 changes: 70 additions & 0 deletions examples/reflection-examples.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: reflection-examples
version: 0.1
license: BSD3
license-file: LICENSE
author: Edward A. Kmett, Elliott Hird, Oleg Kiselyov and Chung-chieh Shan
maintainer: Edward A. Kmett <[email protected]>
stability: experimental
homepage: https://github.com/ekmett/reflection
bug-reports: https://github.com/ekmett/reflection/issues
category: Data, Reflection, Dependent Types
synopsis: Examples of reflection
description: Examples of reflection.
copyright: 2009-2013 Edward A. Kmett,
2012 Elliott Hird,
2004 Oleg Kiselyov and Chung-chieh Shan
build-type: Simple
cabal-version: >= 1.10
tested-with: GHC == 7.0.4
, GHC == 7.2.2
, GHC == 7.4.2
, GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.1

flag examples
default: True

library
if !flag(examples)
buildable: False
exposed-modules: Constraints
Monoid
build-depends: base >= 4.8 && < 5,
constraints,
newtype,
reflection,
tagged
hs-source-dirs: .
ghc-options: -Wall
default-language: Haskell2010

executable reflection-from-json
if !flag(examples)
buildable: False
main-is: FromJSON.hs
build-depends: aeson,
base >= 4.8 && < 5,
lens,
lens-aeson,
reflection,
tagged,
text
hs-source-dirs: .
ghc-options: -Wall -threaded -rtsopts
default-language: Haskell2010

executable reflection-reader-like
if !flag(examples)
buildable: False
main-is: ReaderLike.hs
build-depends: base >= 4.8 && < 5,
reflection,
tagged
hs-source-dirs: .
ghc-options: -Wall -threaded -rtsopts
default-language: Haskell2010

16 changes: 12 additions & 4 deletions reflection.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ description:
.
Austin Seipp's tutorial <https://www.fpcomplete.com/user/thoughtpolice/using-reflection Reflecting values to types and back> provides a summary of the
approach taken by this library, along with more motivating examples.
tested-with: GHC == 7.0.4
, GHC == 7.2.2
, GHC == 7.4.2
, GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.1

extra-source-files:
examples/Monoid.hs
examples/FromJSON.hs
examples/Constraints.hs
examples/Benchmark.hs
examples/reflection-examples.cabal
examples/LICENSE
examples/*.hs
CHANGELOG.markdown
README.markdown
slow/Data/Reflection.hs
Expand Down

0 comments on commit 2e0a731

Please sign in to comment.