Skip to content

Commit

Permalink
Test using github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
agios committed Oct 21, 2023
1 parent cacd19d commit 27909c0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run tests
on: push

jobs:
container-job:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['ruby:3.0', 'ruby:3.1', 'ruby:3.2']

container: ${{ matrix.ruby-version }}

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install dependencies
run: bundle install

- name: Prepare test database
run: bundle exec rake db:create db:migrate
working-directory: ./test/dummy
env:
DATABASE_URL: 'postgresql://postgres:postgres@postgres:5432/unconstrained_test'

- name: Run tests
run: bundle exec rake test
env:
DATABASE_URL: 'postgresql://postgres:postgres@postgres:5432/unconstrained_test'

19 changes: 10 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
unconstrained (0.0.5)
unconstrained (0.0.6)
rails (~> 7.0)

GEM
Expand Down Expand Up @@ -79,7 +79,7 @@ GEM
erubi (1.12.0)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.12.0)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
loofah (2.20.0)
crass (~> 1.0.2)
Expand All @@ -92,7 +92,6 @@ GEM
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
net-imap (0.3.4)
date
Expand All @@ -104,12 +103,13 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
nokogiri (1.15.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
pg (1.4.6)
racc (1.6.2)
rack (2.2.6.4)
racc (1.7.1)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.4.3)
Expand Down Expand Up @@ -149,11 +149,12 @@ GEM
zeitwerk (2.6.7)

PLATFORMS
ruby
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
pg
unconstrained!

BUNDLED WITH
1.17.2
2.4.21
1 change: 1 addition & 0 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Application < Rails::Application
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.active_record.legacy_connection_handling = false
end
end

0 comments on commit 27909c0

Please sign in to comment.