Skip to content

Run tests on Travis #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 59 additions & 40 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,71 @@ before_cache:

matrix:
include:
- env: CABALVER=1.16 GHCVER=7.0.1
- env: CABALVER=1.24 GHCVER=7.0.1
compiler: ": #GHC 7.0.1"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.1], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.0.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.0.2
compiler: ": #GHC 7.0.2"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.0.3
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.0.3
compiler: ": #GHC 7.0.3"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.3], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.0.4
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.3], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.0.4
compiler: ": #GHC 7.0.4"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.2.1
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.4], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.2.1
compiler: ": #GHC 7.2.1"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.1], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.2.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.2.2
compiler: ": #GHC 7.2.2"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.4.1
addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.4.1
compiler: ": #GHC 7.4.1"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.1], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.4.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.4.2
compiler: ": #GHC 7.4.2"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.6.1
addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.6.1
compiler: ": #GHC 7.6.1"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.1], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.6.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.6.2
compiler: ": #GHC 7.6.2"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.6.3
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.6.3
compiler: ": #GHC 7.6.3"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
- env: CABALVER=1.18 GHCVER=7.8.1
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.8.1
compiler: ": #GHC 7.8.1"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.1], sources: [hvr-ghc]}}
- env: CABALVER=1.18 GHCVER=7.8.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.8.2
compiler: ": #GHC 7.8.2"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.2], sources: [hvr-ghc]}}
- env: CABALVER=1.18 GHCVER=7.8.3
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.8.3
compiler: ": #GHC 7.8.3"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.3], sources: [hvr-ghc]}}
- env: CABALVER=1.18 GHCVER=7.8.4
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.3], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.8.4
compiler: ": #GHC 7.8.4"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- env: CABALVER=1.22 GHCVER=7.10.1
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.10.1
compiler: ": #GHC 7.10.1"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
- env: CABALVER=1.22 GHCVER=7.10.2
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.10.2
compiler: ": #GHC 7.10.2"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
- env: CABALVER=1.22 GHCVER=7.10.3
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=7.10.3
compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.1
compiler: ": #GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}

before_install:
- unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- if [ "$GHCVER" != "7.2.1" ];
then
export TEST_OPTS="--enable-tests --enable-benchmarks";
fi

install:
- cabal --version
Expand All @@ -85,7 +89,13 @@ install:
fi
- travis_retry cabal update -v
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- cabal install --only-dependencies --dry -v > installplan.txt
# can't use "cabal install --only-dependencies --enable-tests" due to dep-cycle
- if [ -n "$TEST_OPTS" ];
then
cabal install 'test-framework == 0.8.*' 'test-framework-hunit == 0.3.*' 'HUnit >= 1.2 && < 1.6' --dry -v > installplan.txt;
else
cabal install --only-dependencies --dry -v > installplan.txt;
fi
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt

# check whether current requested install-plan matches cached package-db snapshot
Expand All @@ -99,9 +109,14 @@ install:
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install --only-dependencies;
if [ -n "$TEST_OPTS" ];
then
cabal install -j 'test-framework == 0.8.*' 'test-framework-hunit == 0.3.*' 'HUnit >= 1.2 && < 1.6';
else
cabal install -j --only-dependencies;
fi
fi

# snapshot package-db on cache miss
- if [ ! -d $HOME/.cabsnap ];
then
Expand All @@ -115,9 +130,13 @@ install:
# any command which exits with a non-zero exit code causes the build to fail.
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
- cabal configure -v2 # -v2 provides useful information for debugging
- cabal configure $TEST_OPTS -v2 # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal sdist # tests that a source-distribution can be generated
- if [ -n "$TEST_OPTS" ];
then
cabal test --show-details=always;
fi

# Check that the resulting source distribution can be built & installed.
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
Expand Down
3 changes: 2 additions & 1 deletion deepseq.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ test-suite deepseq-generics-tests
build-depends:
array,
base,
ghc-prim,
-- end of packages with inherited version constraints
test-framework == 0.8.*,
test-framework-hunit == 0.3.*,
HUnit >= 1.2 && < 1.4
HUnit >= 1.2 && < 1.6