2017-03-22 13:03:17 +03:00
# https://docs.travis-ci.com/user/customizing-the-build
2017-03-22 21:19:27 +03:00
# https://docs.travis-ci.com/user/caching/
# https://docs.travis-ci.com/user/languages/haskell/
# http://docs.haskellstack.org/en/stable/travis_ci.html
# https://raw.githubusercontent.com/commercialhaskell/stack/master/doc/travis-simple.yml
# https://raw.githubusercontent.com/commercialhaskell/stack/master/doc/travis-complex.yml
# https://github.com/hvr/multi-ghc-travis#user-content-travisyml-template-for-non-container-based-infrastructure
2017-03-31 00:17:46 +03:00
# https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
# https://github.com/koterpillar/tianbar/blob/master/Dockerfile.base - custom docker image to save time
# https://github.com/mapnik/mapnik/blob/master/.travis.yml
2017-03-22 13:03:17 +03:00
#
# The Build Lifecycle #
# A build on Travis CI is made up of two steps:
# install: install any dependencies required
# script: run the build script
# You can run custom commands before the installation step (before_install), and before (before_script) or after (after_script) the script step.
# In a before_install step, you can install additional dependencies required by your project such as Ubuntu packages or custom services.
# You can perform additional steps when your build succeeds or fails using the after_success (such as building documentation, or deploying to a custom server) or after_failure (such as uploading log files) options. In both after_failure and after_success, you can access the build result using the $TRAVIS_TEST_RESULT environment variable.
# The complete build lifecycle, including three optional deployment steps and after checking out the git repository and changing to the repository directory, is:
#
# OPTIONAL Install apt addons
# OPTIONAL Install cache components
# before_install
# install
# before_script
# script
# OPTIONAL before_cache (for cleaning up cache)
2017-03-22 21:19:27 +03:00
# Travis CI uploads the cache after the script phase of the build, but before either after_success or after_failure.
# Failure to upload the cache does not mark the job as failed.
2017-03-22 13:03:17 +03:00
# after_success or after_failure
# OPTIONAL before_deploy
# OPTIONAL deploy
# OPTIONAL after_deploy
# after_script
2017-03-31 04:19:54 +03:00
#
# we limit the `make` to 40 min
# to ensure that slow builds still upload their
# cache results and therefore should be faster
# (and might work) for the next build
# - DURATION=2400
# - scripts/travis-command-wrapper.py -s "date" -i 120 --deadline=$(( $(date +%s) + ${DURATION} )) make
2016-01-15 07:48:44 +03:00
2015-07-29 00:05:06 +03:00
sudo : false
2015-08-24 20:10:33 +03:00
2017-03-22 21:19:27 +03:00
dist : trusty
language : generic
2015-07-29 00:05:06 +03:00
cache :
2017-03-22 21:19:27 +03:00
timeout : 1000
2015-07-29 00:05:06 +03:00
directories :
2015-07-29 03:04:47 +03:00
- $HOME/.stack/
2017-03-22 13:11:54 +03:00
- $HOME/.local/bin/
2017-03-29 04:44:13 +03:00
- .stack-work/
2018-03-26 01:20:31 +03:00
- hledger-lib/.stack-work/
- hledger/.stack-work/
- hledger-ui/.stack-work/
- hledger-web/.stack-work/
- hledger-api/.stack-work/
2017-08-25 23:39:30 +03:00
# - shelltestrunner/
2015-07-29 00:05:06 +03:00
2017-03-22 11:40:25 +03:00
# addons:
# apt:
# packages:
# - libgmp-dev
branches :
only :
- master
# matrix:
# include:
# - env: ARGS=""
# - env: ARGS="--stack-yaml stack-7.10.yaml"
2017-03-22 13:03:17 +03:00
# - ghc: 7.10.3
# - ghc: 8.0.2
2017-03-22 11:40:25 +03:00
2017-12-15 04:15:38 +03:00
#before_install:
# - ./.travis-maybe-skip.sh
# never seemed to work, and can fail, eg:
# https://travis-ci.org/simonmichael/hledger/builds/316707766
2017-07-12 09:41:06 +03:00
2017-03-31 04:19:54 +03:00
install : # command output is hidden as they complete
2017-03-22 21:19:27 +03:00
2017-03-31 20:52:14 +03:00
# if any command fails, end the travis script
- set -e
# warn about nulls ? no, breaks travis
#- set -u
2017-03-28 14:54:13 +03:00
2017-03-22 21:19:27 +03:00
# stack
2015-07-29 03:04:47 +03:00
- mkdir -p ~/.local/bin
2017-03-22 21:19:27 +03:00
- export PATH=~/.local/bin:$PATH
2018-10-24 22:37:19 +03:00
# Fetch latest stack unconditionally. Do this after a stack release or if in doubt.
#- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
# Or, fetch latest stack if a stack is not already installed. Saves a little time/fragility.
- if [[ ! -x ~/.local/bin/stack ]]; then travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
2018-05-10 08:03:41 +03:00
- which stack
- type -a stack
2017-03-21 12:46:01 +03:00
- stack --version
2018-05-10 08:23:28 +03:00
- echo ~
- ~/.local/bin/stack --version
2017-03-22 21:19:27 +03:00
# GHC
2017-03-23 01:36:09 +03:00
- stack setup
- stack exec -- ghc --version
2017-03-22 21:19:27 +03:00
2017-03-31 04:19:54 +03:00
# hledger dependencies, or at least some of them, built separately to use less memory
2017-03-31 00:17:46 +03:00
# - stack build --only-dependencies hledger-lib #hledger hledger-ui # --test
# TODO does this build hledger-lib & hledger, then rebuild them later with -Werror ?
# - stack build cryptohash
# - stack build --only-dependencies hledger-web # --test
# - stack build --only-dependencies hledger-api # --test
2017-03-31 04:19:54 +03:00
# addon dependencies
#- stack build Chart Chart-diagrams colour Diff
2017-03-22 21:19:27 +03:00
2018-02-16 12:38:26 +03:00
# shelltestrunner
- if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
2017-03-22 11:14:07 +03:00
- shelltest --version
2015-08-24 20:15:21 +03:00
2017-03-31 04:19:54 +03:00
script : # command output is not hidden
2017-03-28 00:56:18 +03:00
2017-03-31 04:19:54 +03:00
# less slow
# build hledger packages, ensuring no warnings,
# and any deps not already cached, separately to use less memory
2017-03-31 00:17:46 +03:00
- stack build --ghc-options=-Werror hledger-lib
2018-03-25 03:45:37 +03:00
- stack build --ghc-options=-Werror hledger
2018-02-16 20:37:37 +03:00
2018-03-25 03:45:37 +03:00
# run hledger-lib/hledger functional tests, skipping the ones for addons
- COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons
2018-02-16 20:37:37 +03:00
2018-05-17 03:33:44 +03:00
- stack build --ghc-options=-Werror hledger-ui
2019-03-10 04:13:58 +03:00
- stack build --ghc-options=-Werror hledger-web
- stack build --ghc-options=-Werror hledger-api
2017-03-31 00:17:46 +03:00
2017-06-06 19:34:52 +03:00
# run the built-in hunit tests. This doesn't run the doctests,
# but doesn't require rebuilding and is fast
2017-09-12 04:30:08 +03:00
#- stack exec -- hledger test
2017-06-06 19:34:52 +03:00
2017-03-31 04:19:54 +03:00
# more slow
2017-03-22 13:03:17 +03:00
2017-03-31 04:19:54 +03:00
# build hledger packages, ensuring no warnings, no haddock failures, package test suites passing,
# and any deps not already cached, separately to use less memory
#- stack build --ghc-options=-Werror --test --haddock --no-haddock-deps hledger-lib
#- stack build --ghc-options=-Werror --test --haddock --no-haddock-deps hledger
#- stack build --ghc-options=-Werror --test --haddock --no-haddock-deps hledger-ui
2017-03-31 00:17:46 +03:00
#- stack build --ghc-options=-Werror --test --haddock --no-haddock-deps hledger-web
#- stack build --ghc-options=-Werror --test --haddock --no-haddock-deps hledger-api
2017-03-31 04:19:54 +03:00
2017-03-22 21:19:27 +03:00
# build hledger addons, ensuring no warnings
2017-03-31 04:19:54 +03:00
#- stack build Diff
#- stack build Chart
#- stack build diagrams-lib
#- stack build Chart-diagrams
2017-03-30 23:19:00 +03:00
#- sh -e bin/compile.sh
2017-03-31 04:19:54 +03:00
2017-03-21 12:46:01 +03:00
# run functional tests
2017-03-30 23:19:00 +03:00
#- make functest
#after_script:
#
# # list directory contents
# - pwd
# - ls -laF /
# - ls -laF $HOME
# - ls -laF
#
# # coveralls.io coverage reports
# # - stack install hpc-coveralls
# # - hpc-coveralls count-von-count-tests --exclude-dir=tests --exclude-dir=src/Gyrid --display-report
2015-07-29 01:34:11 +03:00
2015-07-29 02:34:20 +03:00
notifications :
2015-07-29 01:34:11 +03:00
irc :
channels :
- "chat.freenode.net#hledger"
on_success: change # [always|never|change] default : always
on_failure: change # default : always
use_notice : true
2015-07-29 02:48:19 +03:00
skip_join : true
2015-07-29 02:34:20 +03:00
# If you enable skip_join, remember to remove the NO_EXTERNAL_MSGS flag (n) on the IRC channel(s) the bot notifies.
template :
- "%{commit}: %{message} %{build_url}"
# - "%{repository_name} (%{commit}) : %{message} %{build_url}"
2015-07-29 01:34:11 +03:00
# You can interpolate the following variables:
# repository_slug: your GitHub repo identifier (like svenfuchs/minimal)
# repository_name: the slug without the username
# repository: same as repository_slug [Deprecated]
# build_number: build number
# build_id: build id
# branch: branch build name
# commit: shortened commit SHA
# author: commit author name
# commit_message: commit message of build
# commit_subject: first line of the commit message
# result: result of build
# message: travis message to the build
# duration: duration of the build
# compare_url: commit change view URL
# build_url: URL of the build detail
# The default template is:
2015-07-29 02:34:20 +03:00
# - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}"
# - "Change view : %{compare_url}"
# - "Build details : %{build_url}"
2015-07-29 01:34:11 +03:00
2015-07-29 02:34:20 +03:00
# email: # false
# recipients:
# - one@example.com
# - other@example.com
# on_success: [always|never|change] # default: change
# on_failure: [always|never|change] # default: always
2017-12-31 00:49:49 +03:00
webhooks :
urls :
2018-05-18 23:36:11 +03:00
# travis webhook for skylink irc bot, https://devmode.cloud/docs/webhooks.html#hook-travisci
2017-12-31 02:55:54 +03:00
- "https://ingest.devmode.cloud/hooks/travisci?channel=%23hledger-bots&longurl=1"
2017-12-31 00:49:49 +03:00
# on_success: change # default: always
# on_failure: always # default: always
2018-01-02 03:12:25 +03:00
on_start: always # default : never
2017-12-31 00:49:49 +03:00
# on_cancel: always # default: always
# on_error: always # default: always