Skip to content

Commit

Permalink
switch up mysql starting service
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-j-m committed Nov 18, 2024
1 parent a9ba137 commit 3012986
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ jobs:
fail-fast: false
matrix:
ruby: [3.2]
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: odbc_test
ports: ['3306:3306']
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# services:
# mysql:
# image: mysql:8
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: true
# MYSQL_DATABASE: odbc_test
# ports: ['3306:3306']
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_DATABASE: odbc_test
DB_USER: root
DB_PASSWORD: root
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand All @@ -29,10 +33,14 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- name: Install ODBC drivers
run: sudo apt-get install unixodbc unixodbc-dev mysql-client
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Install dependencies
run: bundle install
- name: Run tests
env:
DB: "mysql"
CONN_STR: "DRIVER=MySQL;SERVER=localhost;DATABASE=odbc_test;USER=root;PASSWORD=;"
CONN_STR: "DRIVER=MySQL;SERVER=localhost;DATABASE=${{ env.DB_DATABASE }};USER=${{ env.DB_USER }};PASSWORD=${{ env.DB_PASSWORD }};"
run: bundle exec rake test

0 comments on commit 3012986

Please sign in to comment.