Skip to content

Commit

Permalink
Add MySQL 5.7 to Travis configuration
Browse files Browse the repository at this point in the history
Following the same setup of doctrine/dbal#2764.
  • Loading branch information
lcobucci committed Jul 1, 2017
1 parent 5bef9d9 commit 11224d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ before_script:
- composer install --prefer-source
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
- if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
- if [ "$MYSQL_VERSION" == "5.7" ]; then bash ./tests/travis/install-mysql-5.7.sh; fi;
- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;

script:
Expand All @@ -40,6 +41,13 @@ matrix:
- DB=sqlite
- DEPENDENCIES='low'

- php: 7.1
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
- php: nightly
env: DB=mysql MYSQL_VERSION=5.7
sudo: required

allow_failures:
- php: nightly

Expand Down
22 changes: 22 additions & 0 deletions tests/travis/install-mysql-5.7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -ex

echo "Installing MySQL 5.7..."

sudo service mysql stop
sudo apt-get remove "^mysql.*"
sudo apt-get autoremove
sudo apt-get autoclean
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.8.6-1_all.deb
sudo DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.6-1_all.deb
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server libmysqlclient-dev
sudo mysql_upgrade

echo "Restart mysql..."
sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"

0 comments on commit 11224d8

Please sign in to comment.