Skip to content

Commit

Permalink
Fix issue with MySQL server
Browse files Browse the repository at this point in the history
  • Loading branch information
mechanicles committed Aug 5, 2023
1 parent b0f826b commit 3f60d59
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,7 @@ jobs:
env:
CC_TEST_REPORTER_ID: 353b5634de390dad574939f59c2ef3798b81f06df548f7bdd11cd8225be484f3

services:
postgres:
image: postgres
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 32574:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Show postgres version
run: psql -h localhost -U postgres -d postgres -c 'SHOW server_version'

- name: Checkout code
uses: actions/checkout@v2

Expand All @@ -48,11 +25,14 @@ jobs:
- name: Install dependencies
run: bundle install

- name: Create MySQL and PostgreSQL databases
run: |
sudo apt-get install -y mysql-client
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE DATABASE set_as_primary_test;"
psql --host 127.0.0.1 --port 5432 --username postgres --password password -c "CREATE DATABASE set_as_primary_test;"
- uses: ankane/setup-postgres@v1
with:
database: set_as_primary_test

- uses: ankane/setup-mysql@v1
with:
database: set_as_primary_test
- run: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

- name: Run tests
run: bundle exec rake
Expand Down

0 comments on commit 3f60d59

Please sign in to comment.