Skip to content

Commit

Permalink
switch version of MySQL on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Apr 5, 2024
1 parent c55ea8c commit 1003cf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ jobs:
perl:
- '5.36'
- '5.38'
mysql:
- 'mysql-5.6'
- 'mysql-5.7'
- 'mysql-8.0'
- 'mariadb'
steps:
- uses: actions/checkout@v2
- name: Setup perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- run: |
author/ci_install_mysql.sh
cpanm --quiet --installdeps --notest --with-recommends .
prove -lvr
env:
DATABASE_ADAPTER: ${{ matrix.mysql }}
12 changes: 3 additions & 9 deletions author/travis_install_mysql.sh → author/ci_install_mysql.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -ex

if [[ $DATABASE_ADAPTER =~ (mariadb|mysql-(5\.[567]|8\.0)) ]]; then
if [[ $DATABASE_ADAPTER =~ (mariadb|mysql-(5\.[67]|8\.0)) ]]; then
sudo service mysql stop
sudo apt-get install python-software-properties
if [[ $DATABASE_ADAPTER =~ mariadb ]]; then
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main' ;
# https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -q --yes --force-yes -f --option DPkg::Options::=--force-confnew install mariadb-server
sudo apt-get install libmariadbd-dev
Expand All @@ -19,12 +19,6 @@ EOC
sudo dpkg --install mysql-apt-config_0.8.10-1_all.deb
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::=--force-confnew mysql-server
else
# 5.5
sudo apt-get update -q
sudo rm -rf /var/lib/mysql/ # for downgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -q --yes --force-yes -f --option DPkg::Options::=--force-confnew install mysql-server-5.5 mysql-client-5.5 mysql-server-core-5.5
exit # no need to upgrade
fi
sudo mysql_upgrade
fi

0 comments on commit 1003cf2

Please sign in to comment.