diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 8462143f..dad4dbcd 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -13,6 +13,19 @@ jobs: name: spec env: RAILS_ENV: test + DB_HOST: 127.0.0.1 + services: + db: + image: registry.opensuse.org/opensuse/mariadb:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: >- + --health-cmd="mariadb-admin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 @@ -20,7 +33,6 @@ jobs: bundler-cache: true - name: Prepare spec run: | - sudo systemctl start mysql.service wget -nv http://sphinxsearch.com/files/dicts/en.pak bundle exec rake dev:bootstrap --trace bundle exec bin/rake webdrivers:chromedriver:update diff --git a/config/database.yml.example b/config/database.yml.example index 61d76f88..bec1a550 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -1,6 +1,8 @@ <% if ENV['CONTAINER'] host = 'db' + elsif ENV['DB_HOST'] + host = ENV['DB_HOST'] end %>