Skip to content

Experimental Stack-based Travis-CI (DO NOT MERGE IT) #162

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

Closed
wants to merge 1 commit into from
Closed
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
91 changes: 47 additions & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
# The Travis docs (https://docs.travis-ci.com/user/languages/haskell)
# suggest that we use `language: haskell` and `ghc:` to specify GHC versions.
# However, as of this writing, Travis only supported versions up to 7.8.
# If Travis supports all versions we would like to test, then we could switch.
# Until then, we use the https://github.com/hvr/multi-ghc-travis setup.
language: c
sudo: false
sudo: false # Use the container-based infrastructure.

addons:
apt: &apt
sources:
- hvr-ghc
cabal: &cabal cabal-install-1.22
env:
global:
- CABALVER=1.22
matrix:
include:
- env: GHCVER=7.6.3
addons:
apt:
<<: *apt
packages: [ghc-7.6.3, *cabal]
- env: GHCVER=7.8.4
addons:
apt:
<<: *apt
packages: [ghc-7.8.4, *cabal]
- env: GHCVER=7.10.3
addons:
apt:
<<: *apt
packages: [ghc-7.10.3, *cabal]
- env: GHCVER=8.0.1
addons:
apt:
<<: *apt
packages: [ghc-8.0.1, *cabal]
apt:
packages:
- libgmp-dev # Stack's GHC depends on this.

cache:
directories:
- '$HOME/.ghc'
- '$HOME/.cabal'
- $HOME/.stack # Global stack's cache.
- $HOME/.foldercache # Per exercise `.stack-work` cache.

env:
- RESOLVER="lts-2.22" # Last GHC 7.8.x snapshot.
- RESOLVER="lts-6.4" # Last checked LTS snapshot (GHC 7.10.3).
- RESOLVER="nightly-2016-06-21" # Last checked nightly snapshot (GHC 8.0.1).
- RESOLVER="lts" # Latest LTS snapshot.
- RESOLVER="nightly" # Latest nightly snapshot.

matrix:
allow_failures: # The snapshots `lts` and `nightly` are
- env: RESOLVER="lts" # aliases to the most recent versions.
- env: RESOLVER="nightly" # We don't want to fail when a new version
fast_finish: true # is released, so we list them here.

before_install:
- './_test/bootstrap.sh'
- mkdir -p ${HOME}/bin # Create folder for stack.
- export PATH="${HOME}/bin:$PATH" # For stack
- export PATH="${TRAVIS_BUILD_DIR}/bin:$PATH" # For {,fetch-}configlet.
- export PATH="${TRAVIS_BUILD_DIR}/_test:$PATH" # For stackalize.

install:
- true
- travis_retry fetch-configlet
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 -o pack.tgz
- tar xzf pack.tgz --wildcards --strip-components=1 -C ${HOME}/bin '*/stack'

script:
- 'export PATH=/opt/cabal/$CABALVER/bin:/opt/ghc/$GHCVER/bin:$PATH'
- 'runhaskell -Wall ./_test/check-exercises.hs'
- './bin/fetch-configlet'
- './bin/configlet .'
- |
set -e
configlet .
for exercise in ${TRAVIS_BUILD_DIR}/exercises/* ; do
pushd ${exercise}
# `stack --word-dir` fails if not targeting a subdirectory, so we just
# symbolic-link `.stack-work` to a subfolder in the cache directory.
mkdir -p "${HOME}/.foldercache/${exercise}/.stack-work"
ln -f -s "${HOME}/.foldercache/${exercise}/.stack-work"
stackalize --resolver lts-0.0 `# This resolver is not used. `
stack test --resolver "${RESOLVER}" `# Select the correct resolver. `\
--install-ghc `# Download GHC if not in cache.`\
--no-terminal `# Terminal detection is broken.`\
--pedantic `# Enable -Wall and -Werror. `
popd
done
27 changes: 0 additions & 27 deletions _test/bootstrap.sh

This file was deleted.