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 0c72bab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@ on:
pull_request: {}
jobs:
test:
name: Run Test with Perl ${{ matrix.perl }}
name: Run Test with Perl ${{ matrix.perl }} on ${{ matrix.mysql }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
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 }}
15 changes: 5 additions & 10 deletions author/travis_install_mysql.sh → author/ci_install_mysql.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/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
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B7B3B788A8D3785C
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 +20,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 0c72bab

Please sign in to comment.