forked from winterland1989/mysql-haskell
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
77 lines (69 loc) · 3.96 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
sudo: required
dist: trusty
env:
- CABALVER=1.18 GHCVER=7.8.4 MYSQLVER=5.5
- CABALVER=1.22 GHCVER=7.10.2 MYSQLVER=5.5
- CABALVER=1.24 GHCVER=8.0.1 MYSQLVER=5.5
- CABALVER=1.24 GHCVER=8.0.1 MYSQLVER=5.6
- CABALVER=1.24 GHCVER=8.0.1 MYSQLVER=5.7
# Note: the distinction between `before_install` and `install` is not important.
before_install:
- export DEBIAN_FRONTEND=noninteractive
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- travis_retry sudo apt-get install happy-1.19.4 alex-3.1.3
- export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
- |
if [ ${MYSQLVER} == "5.7" ]; then
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb
sudo dpkg --install mysql-apt-config_0.7.3-1_all.deb
sudo apt-get update -q
sudo apt-get install -q --force-yes -o Dpkg::Options::=--force-confnew mysql-server
sudo mysql_upgrade
sudo mysql -V
sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS testMySQLHaskell;"
sudo mysql -u root -e "CREATE USER 'testMySQLHaskell'@'localhost' IDENTIFIED BY ''"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON testMySQLHaskell.* TO 'testMySQLHaskell'@'localhost'"
sudo mysql -u root -e "GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'testMySQLHaskell'@'localhost';"
sudo mysql -u root -e "FLUSH PRIVILEGES"
sudo echo "max_allowed_packet=256M" | sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf
sudo echo "server-id = 1" | sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf
sudo echo "log_bin = /var/log/mysql/mysql-bin.log" | sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf
sudo service mysql restart
else
travis_retry sudo apt-get install -q -y mysql-server-${MYSQLVER} mysql-client-core-${MYSQLVER} mysql-client-${MYSQLVER}
mysql -V
mysql -u root -e "CREATE DATABASE IF NOT EXISTS testMySQLHaskell;"
mysql -u root -e "CREATE USER 'testMySQLHaskell'@'localhost' IDENTIFIED BY ''"
mysql -u root -e "GRANT ALL PRIVILEGES ON testMySQLHaskell.* TO 'testMySQLHaskell'@'localhost'"
mysql -u root -e "GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'testMySQLHaskell'@'localhost';"
mysql -u root -e "FLUSH PRIVILEGES"
sudo echo "[mysqld]" | sudo tee -a /etc/mysql/my.cnf
sudo echo "max_allowed_packet=256M" | sudo tee -a /etc/mysql/my.cnf
sudo echo "server-id = 1" | sudo tee -a /etc/mysql/my.cnf
sudo echo "log_bin = /var/log/mysql/mysql-bin.log" | sudo tee -a /etc/mysql/my.cnf
sudo echo "binlog_format = ROW" | sudo tee -a /etc/mysql/my.cnf
sudo service mysql restart
fi
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- cabal install --only-dependencies --enable-tests --enable-benchmarks
# Here starts the actual work to be performed for the package under test; 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 --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal test
- cabal bench
- cabal check
- cabal sdist # tests that a source-distribution can be generated
# 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:
# `cabal install --force-reinstalls dist/*-*.tar.gz`
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")