forked from hslua/hslua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
85 lines (77 loc) · 2.98 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
sudo: false
language: generic
# Speed builds up by caching install requirements
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
matrix:
include:
## Test Compilers
# Test GHC 7.10.3
- env: GHCVER=7.10.3 LUAVER=default CABALVER=1.22
compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
# Test GHC 8.0.2
- env: GHCVER=8.0.2 LUAVER=default CABALVER=2.0
compiler: ": #GHC 8.0.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.0.2], sources: [hvr-ghc]}}
# Test GHC 8.2.2
- env: GHCVER=8.2.2 LUAVER=default CABALVER=2.0
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
# Test GHC 8.4.3
- env: GHCVER=8.4.3 LUAVER=default CABALVER=2.0
compiler: ": #GHC 8.4.3"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.4.3], sources: [hvr-ghc]}}
# Test GHC 8.6
- env: GHCVER=8.6.1 LUAVER=default CABALVER=2.0
compiler: ": #GHC 8.6.1"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.6.1], sources: [hvr-ghc]}}
## Test system Lua
# Test system Lua 5.3
- env: GHCVER=8.4.3 LUAVER=lua-5.3.5 CABALVER=2.0
compiler: ": #GHC 8.4.3"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.4.3], sources: [hvr-ghc]}}
# mark build as successful as soon as all required successes are in.
fast_finish: true
before_install:
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH
- cabal update
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- echo "$(cabal --version)"
- cabal install --only-dependencies --enable-tests --disable-optimization
script:
- CABAL_CONFIG_ARGS=""
- |
# Enable coverage testing for the main repo only as it will fail otherwise.
if [ -n "${COVERAGE}" ] && [ "${TRAVIS_REPO_SLUG}" = "hslua/hslua" ]; then
CABAL_CONFIG_ARGS="--enable-library-coverage";
fi
- |
case "$LUAVER" in
(lua-5*):
# Install Lua
wget http://www.lua.org/ftp/${LUAVER}.tar.gz
tar -xf ${LUAVER}.tar.gz
cd ${LUAVER}
sed -i 's/^CFLAGS= -O2 -Wall/CFLAGS= -O2 -Wall -fPIC/' src/Makefile
make linux
make install INSTALL_TOP=${HOME}/usr
cd ..
# Compile and link using system-wide Lua
CABAL_CONFIG_ARGS="$CABAL_CONFIG_ARGS -fsystem-lua"
CABAL_CONFIG_ARGS="$CABAL_CONFIG_ARGS --extra-include-dirs=${HOME}/usr/include"
CABAL_CONFIG_ARGS="$CABAL_CONFIG_ARGS --extra-lib-dirs=${HOME}/usr/lib"
;;
esac
- export LD_LIBRARY_PATH=${HOME}/usr/lib:$LD_LIBRARY_PATH
- echo $CABAL_CONFIG_ARGS
- cabal configure --enable-tests --disable-optimization $([ $GHCVER == "7.10.3" ] || printf '--ghc-options="-Werror"') $CABAL_CONFIG_ARGS
- cabal build
- cabal test
- cabal copy
- cabal sdist
# Run HLint
- curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s .