Skip to content

Commit

Permalink
Activate Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
timfjord committed Oct 21, 2021
1 parent ab8344b commit 5ae8d5f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI Tests

on:
push:
branches: [master]
pull_request:
branches: ['**']

jobs:
test:
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DB: i18n_unittest
MYSQL_USER: root
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_PASSWORD: ''
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 'head']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require 'i18n/backend/active_record'
case ENV['DB']
when 'postgres'
::ActiveRecord::Base.establish_connection adapter: 'postgresql', database: 'i18n_unittest', username: ENV['PG_USER'] || 'i18n', password: '', host: 'localhost'
::ActiveRecord::Base.establish_connection adapter: 'postgresql', database: 'i18n_unittest', username: ENV['PG_USER'] || 'postgres', password: '', host: 'localhost'
when 'mysql'
::ActiveRecord::Base.establish_connection adapter: 'mysql2', database: 'i18n_unittest', username: 'root', password: '', host: 'localhost'
else
Expand Down

0 comments on commit 5ae8d5f

Please sign in to comment.