Skip to content

Commit d4b450b

Browse files
authored
Merge pull request diesel-rs#2466 from JohnTitor/mysql-version
Use version number from installed lib
2 parents 02cae94 + b65d41a commit d4b450b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,17 @@ jobs:
121121
- name: Install mysql (MacOS)
122122
if: runner.os == 'macOS' && matrix.backend == 'mysql'
123123
run: |
124-
brew update &&
125-
brew install mysql &&
126-
brew services start mysql &&
127-
brew services stop mysql;sleep 3;brew services start mysql &&
128-
sleep 2 &&
129-
/usr/local/Cellar/mysql/8.0.21/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot
124+
brew update
125+
brew install mysql
126+
brew services start mysql
127+
brew services stop mysql;sleep 3;brew services start mysql
128+
sleep 2
129+
macos_mysql_version="$(ls /usr/local/Cellar/mysql)"
130+
/usr/local/Cellar/mysql/${macos_mysql_version}/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot
130131
echo '::set-env name=MYSQL_DATABASE_URL::mysql://root@localhost/diesel_test'
131132
echo '::set-env name=MYSQL_EXAMPLE_DATABASE_URL::mysql://root@localhost/diesel_example'
132133
echo '::set-env name=MYSQL_UNIT_TEST_DATABASE_URL::mysql://root@localhost/diesel_unit_test'
133-
echo '::set-env name=MYSQLCLIENT_LIB_DIR::/usr/local/Cellar/mysql/8.0.21/lib'
134+
echo '::set-env name=MYSQLCLIENT_LIB_DIR::/usr/local/Cellar/mysql/${macos_mysql_version}/lib'
134135
135136
- name: Install sqlite (Windows)
136137
if: runner.os == 'Windows' && matrix.backend == 'sqlite'

0 commit comments

Comments
 (0)