.travis.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. # Adapted from https://github.com/haskell-CI/haskell-ci
  2. # NB: don't set `language: haskell` here.
  3. language: c
  4. # Request Ubuntu Trusty (14.04 LTS).
  5. dist: trusty
  6. # Explicitly request sudo-enabled virtual environments [Issue #1992].
  7. sudo: required
  8. cache:
  9. directories:
  10. - $HOME/.stack
  11. ##############################################################################
  12. # Required Ubuntu packages
  13. # The LaTeX/HTML test-suite requires:
  14. # * `kpsewhich` (included in texlive-binaries)
  15. ##############################################################################
  16. # Tests
  17. # We use the word 'test' in a broad sense (e.g. it includes the Agda
  18. # test suite, the benchmark suite, the compilation with a specific set
  19. # of dependencies, the testing of other programs like `hTags`, etc.)
  20. # Travis runs the builds on this order.
  21. matrix:
  22. include:
  23. - env: TEST=MAIN GHC_VER=8.6.3 BUILD=CABAL CABAL_VER=2.4
  24. addons:
  25. apt:
  26. packages:
  27. - cabal-install-2.4
  28. - ghc-8.6.3
  29. - texlive-binaries
  30. sources:
  31. - hvr-ghc
  32. - env: TEST=MAIN GHC_VER=8.4.4 BUILD=CABAL CABAL_VER=2.2
  33. addons:
  34. apt:
  35. packages:
  36. - cabal-install-2.2
  37. - ghc-8.4.4
  38. - texlive-binaries
  39. sources:
  40. - hvr-ghc
  41. - env: TEST=MAIN GHC_VER=8.2.2 BUILD=CABAL CABAL_VER=2.0
  42. addons:
  43. apt:
  44. packages:
  45. - cabal-install-2.0
  46. - ghc-8.2.2
  47. - texlive-binaries
  48. sources:
  49. - hvr-ghc
  50. - env: TEST=MAIN GHC_VER=8.0.2 BUILD=CABAL CABAL_VER=1.24
  51. addons:
  52. apt:
  53. packages:
  54. - cabal-install-1.24
  55. - ghc-8.0.2
  56. - texlive-binaries
  57. sources:
  58. - hvr-ghc
  59. - env: TEST=MAIN GHC_VER=7.10.3 BUILD=CABAL CABAL_VER=1.22
  60. addons:
  61. apt:
  62. packages:
  63. - cabal-install-1.22
  64. - ghc-7.10.3
  65. - texlive-binaries
  66. sources:
  67. - hvr-ghc
  68. - env: TEST=STACKAGE GHC_VER=8.6.3 BUILD=STACK ARGS="--stack-yaml stack-8.6.3.yaml --system-ghc"
  69. addons:
  70. apt:
  71. packages:
  72. - ghc-8.6.3
  73. sources:
  74. - hvr-ghc
  75. - env: TEST=STACKAGE GHC_VER=8.4.4 BUILD=STACK ARGS="--stack-yaml stack-8.4.4.yaml --system-ghc"
  76. addons:
  77. apt:
  78. packages:
  79. - ghc-8.4.4
  80. sources:
  81. - hvr-ghc
  82. - env: TEST=STACKAGE GHC_VER=8.2.2 BUILD=STACK ARGS="--stack-yaml stack-8.2.2.yaml --system-ghc"
  83. addons:
  84. apt:
  85. packages:
  86. - ghc-8.2.2
  87. sources:
  88. - hvr-ghc
  89. - env: TEST=STACKAGE GHC_VER=8.0.2 BUILD=STACK ARGS="--stack-yaml stack-8.0.2.yaml --system-ghc"
  90. addons:
  91. apt:
  92. packages:
  93. - ghc-8.0.2
  94. sources:
  95. - hvr-ghc
  96. - env: TEST=STACKAGE GHC_VER=7.10.3 BUILD=STACK ARGS="--stack-yaml stack-7.10.3.yaml --system-ghc"
  97. addons:
  98. apt:
  99. packages:
  100. - ghc-7.10.3
  101. sources:
  102. - hvr-ghc
  103. # Since `stack haddock` compiles Agda but `cabal haddock` does
  104. # not, this test is faster using `BUILD=CABAL` [Issue #2188].
  105. - env: TEST=HADDOCK GHC_VER=8.6.3 BUILD=CABAL CABAL_VER=2.4
  106. addons:
  107. apt:
  108. packages:
  109. - cabal-install-2.4
  110. - ghc-8.6.3
  111. sources:
  112. - hvr-ghc
  113. - env: TEST=USER_MANUAL BUILD=NOTHING
  114. language: python
  115. python: "3.4"
  116. allow_failures:
  117. - env: TEST=USER_MANUAL BUILD=NOTHING
  118. language: python
  119. python: "3.4"
  120. # Builds are loooong, we want to send an email as fast as possible.
  121. fast_finish: true
  122. ##############################################################################
  123. before_install:
  124. - if [[ $TEST = "MAIN" || $TEST = "HADDOCK" ]]; then
  125. export PATH=/opt/ghc/$GHC_VER/bin:/opt/cabal/$CABAL_VER/bin:$PATH;
  126. elif [[ $TEST = "STACKAGE" ]]; then
  127. export PATH=/opt/ghc/$GHC_VER/bin:$PATH;
  128. fi
  129. - if [[ $BUILD = "STACK" ]]; then
  130. mkdir -p ~/.local/bin &&
  131. travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' &&
  132. export PATH=$HOME/.local/bin:$PATH;
  133. fi
  134. ##############################################################################
  135. install:
  136. # How much memory we have.
  137. - vmstat -s
  138. # Asking for the shell.
  139. - echo $SHELL
  140. # Node is pre-installed.
  141. - echo "*** Node version ***"
  142. - node --version
  143. # The container environment reports a wrong number of cores. We use
  144. # a `sed` script (from https://github.com/hvr/multi-ghc-travis) for
  145. # commenting out `jobs: $ncpus` in the Cabal configuration file.
  146. - if [[ $BUILD = "CABAL" ]]; then
  147. echo "*** Cabal version ***" &&
  148. cabal --version &&
  149. echo "*** GHC version ***" &&
  150. ghc --version &&
  151. echo "*** Haddock version ***" &&
  152. haddock --version &&
  153. echo "*** Emacs version ***" &&
  154. emacs --version &&
  155. export PARALLEL_TESTS=2 &&
  156. travis_retry cabal update &&
  157. sed -i 's/^jobs:/-- jobs:/' $HOME/.cabal/config &&
  158. cat $HOME/.cabal/config &&
  159. export PATH=$HOME/.cabal/bin:$PATH &&
  160. travis_retry cabal update &&
  161. travis_retry cabal fetch alex happy &&
  162. cabal install -v0 alex happy &&
  163. echo "*** Alex version ***" &&
  164. alex --version &&
  165. echo "*** Happy version ***" &&
  166. happy --version ;
  167. fi
  168. - if [[ $BUILD = "STACK" ]]; then
  169. echo "*** GHC version ***" &&
  170. ghc --version &&
  171. echo "*** Haddock version ***" &&
  172. haddock --version &&
  173. echo "*** Emacs version ***" &&
  174. emacs --version &&
  175. echo "*** Stack version ***" &&
  176. stack --version ;
  177. fi
  178. ##############################################################################
  179. # Installing the dependencies
  180. # N.B. that `cabal install` doesn't set up the number of jobs by default
  181. # (cabal-install 1.22.4.0). See https://github.com/haskell/cabal/issues/2628.
  182. # TODO (2016-02-21): Split the long lines (`\` doesn't work).
  183. # N.B. that we use the `--force-reinstalls` option [Issue 1520].
  184. # We are using `make CABAL_OPTS...` because we are including the
  185. # options to `cabal install` set up in the `Makefile`.
  186. - if [[ $TEST = "MAIN" || $TEST = "HADDOCK" ]]; then
  187. travis_retry cabal fetch `cabal install --dependencies-only --force-reinstalls --dry-run | sed 1,2d | sed "s|(latest[^)]*)||g"` &&
  188. make CABAL_OPTS='-v0 --only-dependencies --force-reinstalls' install-bin;
  189. elif [[ $TEST = "STACKAGE" ]]; then
  190. stack build $ARGS --no-terminal --only-dependencies;
  191. fi
  192. ##############################################################################
  193. # Installing Agda
  194. - export BUILD_DIR=$HOME/dist
  195. - if [[ $TEST = "MAIN" ]]; then
  196. make BUILD_DIR=$BUILD_DIR CABAL_OPTS=-v1 install-bin;
  197. fi
  198. ##############################################################################
  199. # Getting the standard library
  200. - if [[ $TEST = "MAIN" ]]; then
  201. make up-to-date-std-lib;
  202. fi
  203. ##############################################################################
  204. # Installing Sphinx
  205. # Required for making the user manual.
  206. # Note that the `--user` option put the Sphinx binaries in
  207. # `$HOME/.local/bin`.
  208. - if [[ $TEST = "USER_MANUAL" ]]; then
  209. pip install -r doc/user-manual/requirements.txt &&
  210. export PATH=$HOME/.local/bin:$PATH &&
  211. echo "*** sphinx-build version ***" &&
  212. sphinx-build --version ;
  213. fi
  214. ##############################################################################
  215. # Installing TeX Live and LaTeX packages (required by the user manual)
  216. # A *recent* version of TeX Live is required for making the user
  217. # manual. The installation of TeX Live was based on the instructions
  218. # used by Travis when the build environment is `language : r`.
  219. - if [[ $TEST = "USER_MANUAL" ]]; then
  220. travis_retry curl -Lo /tmp/texlive.tar.gz https://github.com/jimhester/ubuntu-bin/releases/download/latest/texlive.tar.gz &&
  221. tar xzf /tmp/texlive.tar.gz -C ~ &&
  222. export PATH=$HOME/texlive/bin/x86_64-linux:$PATH &&
  223. tlmgr update --self &&
  224. tlmgr install anyfontsize capt-of cmap dejavu dvipng fncychap latexmk needspace &&
  225. echo "*** pdfLaTeX version ***" &&
  226. pdflatex --version &&
  227. echo "*** Latexmk version ***" &&
  228. latexmk --version &&
  229. echo "*** XeLaTeX version ***" &&
  230. xelatex --version ;
  231. fi
  232. ##############################################################################
  233. # Installing a recent version of Node (see Issue #2192)
  234. - if [[ $TEST = "MAIN" ]]; then
  235. export AGDA_HOME=`pwd` &&
  236. export NODE_VERSION=v0.12.16 &&
  237. export NODE_DIR=node-${NODE_VERSION}-linux-x64 &&
  238. export NODE_TARBALL=${NODE_DIR}.tar.xz &&
  239. cd $HOME &&
  240. travis_retry wget https://nodejs.org/download/release/${NODE_VERSION}/${NODE_TARBALL} &&
  241. tar xJf ${NODE_TARBALL} &&
  242. export PATH=${HOME}/${NODE_DIR}/bin:$PATH &&
  243. cd $AGDA_HOME &&
  244. echo "*** Node version ***" &&
  245. node --version ;
  246. fi
  247. ##############################################################################
  248. # Some tests
  249. # ASR (2016-09-17). Running the following tests, which use stack, here
  250. # instead of in the `script` section is faster because Agda's
  251. # dependencies are not installed again.
  252. ##############################################################################
  253. # We test on Stackage the default and non-default Agda flags.
  254. # Default flags: `cpp` instead of `cpphs`, `debug` off and
  255. # `enable-cluster-counting` off.
  256. # Issues related to the flags: `cpp` instead of `cpphs` [Issue #1647]
  257. # and the `debug` flag [Issue #2070].
  258. # N.B. that these tests are not include in the Makefile tests.
  259. - if [[ $TEST = "STACKAGE" ]]; then
  260. stack build $ARGS --no-terminal &&
  261. stack clean $ARGS &&
  262. stack build $ARGS --no-terminal --flag Agda:cpphs --flag Agda:debug --flag Agda:enable-cluster-counting;
  263. fi
  264. ##############################################################################
  265. script:
  266. ##############################################################################
  267. - if [[ $TEST = "MAIN" ]]; then
  268. make check-whitespace;
  269. fi
  270. - if [[ $TEST = "MAIN" ]]; then
  271. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR succeed;
  272. fi
  273. - if [[ $TEST = "MAIN" ]]; then
  274. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR fail;
  275. fi
  276. - if [[ $TEST = "MAIN" ]]; then
  277. make BUILD_DIR=$BUILD_DIR interaction;
  278. fi
  279. - if [[ $TEST = "MAIN" ]]; then
  280. make BUILD_DIR=$BUILD_DIR interactive;
  281. fi
  282. # We don't run LaTeX/XeLaTeX/LuaLaTeX on Travis (see Issues #1022 and
  283. # #1675), but we still compare the generated tex/html files with the
  284. # golden files.
  285. - if [[ $TEST = "MAIN" ]]; then
  286. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR DONT_RUN_LATEX="Y" latex-html-test;
  287. fi
  288. - if [[ $TEST = "MAIN" ]]; then
  289. make BUILD_DIR=$BUILD_DIR examples;
  290. fi
  291. - if [[ $TEST = "MAIN" ]]; then
  292. make BUILD_DIR=$BUILD_DIR library-test;
  293. fi
  294. - if [[ $TEST = "MAIN" ]]; then
  295. make BUILD_DIR=$BUILD_DIR api-test;
  296. fi
  297. - if [[ $TEST = "MAIN" ]]; then
  298. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR user-manual-test;
  299. fi
  300. - if [[ $TEST = "MAIN" ]]; then
  301. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR internal-tests;
  302. fi
  303. - if [[ $TEST = "MAIN" ]]; then
  304. make BUILD_DIR=$BUILD_DIR benchmark-without-logs;
  305. fi
  306. - if [[ $TEST = "MAIN" ]]; then
  307. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR compiler-test;
  308. fi
  309. - if [[ $TEST = "MAIN" ]]; then
  310. make AGDA_TESTS_OPTIONS="-j${PARALLEL_TESTS} --hide-successes" BUILD_DIR=$BUILD_DIR lib-succeed;
  311. fi
  312. - if [[ $TEST = "MAIN" ]]; then
  313. make BUILD_DIR=$BUILD_DIR lib-interaction;
  314. fi
  315. - if [[ $TEST = "MAIN" ]]; then
  316. make BUILD_DIR=$BUILD_DIR TAGS;
  317. fi
  318. - if [[ $TEST = "MAIN" ]]; then
  319. cabal install -v0 --ghc-option=-w shelltestrunner &&
  320. make test-size-solver;
  321. fi
  322. - if [[ $TEST = "MAIN" ]]; then
  323. make BUILD_DIR=$BUILD_DIR testing-emacs-mode;
  324. fi
  325. - if [[ $TEST = "MAIN" ]]; then
  326. make install-agda-bisect;
  327. fi
  328. ##############################################################################
  329. # Testing Haddock [Issue 1773]
  330. - if [[ $TEST = "HADDOCK" ]]; then
  331. make BUILD_DIR=$BUILD_DIR haddock;
  332. fi
  333. ##############################################################################
  334. # Making the user manual
  335. - if [[ $TEST = "USER_MANUAL" ]]; then
  336. make user-manual-html &&
  337. make user-manual-pdf &&
  338. make user-manual-linkcheck ;
  339. fi
  340. ##############################################################################
  341. # Every master and maintenance branches >= 2.5 or >= maint-2.4 must
  342. # be here. You can also add your private branches if you want travis to
  343. # test them.
  344. branches:
  345. only:
  346. - master
  347. - future
  348. - maint-2.4
  349. - stable-2.5
  350. - release-2.5.1