From 3f60d5980425ba3438bd023737b9961f9ae0e185 Mon Sep 17 00:00:00 2001 From: Santosh Wadghule Date: Sat, 5 Aug 2023 18:41:44 +0530 Subject: [PATCH] Fix issue with MySQL server --- .github/workflows/main.yml | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0fdce81..665ab0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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