Skip to content

Commit f1ba235

Browse files
Copilotmoio
andcommitted
Use MariaDB service in GitHub Actions instead of MySQL
Co-authored-by: moio <250541+moio@users.noreply.github.com> Signed-off-by: Silvio Moioli <silvio@moioli.net>
1 parent 07492e3 commit f1ba235

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/spec.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ jobs:
1313
name: spec
1414
env:
1515
RAILS_ENV: test
16+
DB_HOST: 127.0.0.1
17+
services:
18+
db:
19+
image: registry.opensuse.org/opensuse/mariadb:latest
20+
env:
21+
MYSQL_ROOT_PASSWORD: root
22+
ports:
23+
- 3306:3306
24+
options: >-
25+
--health-cmd="mariadb-admin ping"
26+
--health-interval=10s
27+
--health-timeout=5s
28+
--health-retries=3
1629
steps:
1730
- uses: actions/checkout@v2
1831
- uses: ruby/setup-ruby@v1
1932
with:
2033
bundler-cache: true
2134
- name: Prepare spec
2235
run: |
23-
sudo systemctl start mysql.service
2436
wget -nv http://sphinxsearch.com/files/dicts/en.pak
2537
bundle exec rake dev:bootstrap --trace
2638
bundle exec bin/rake webdrivers:chromedriver:update

config/database.yml.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<%
22
if ENV['CONTAINER']
33
host = 'db'
4+
elsif ENV['DB_HOST']
5+
host = ENV['DB_HOST']
46
end
57
%>
68

0 commit comments

Comments
 (0)