diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..aa29b1f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -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' + diff --git a/Gemfile.lock b/Gemfile.lock index 10e36b7..b16949b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - unconstrained (0.0.5) + unconstrained (0.0.6) rails (~> 7.0) GEM @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index a7f7de3..a0864b9 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -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