diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 280b2df..4722c3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,43 +4,46 @@ jobs: build: if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ubuntu-latest + services: + postgres: + image: postgres:15 + env: + POSTGRES_DB: action-store-test + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "123456" + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 strategy: fail-fast: false matrix: include: - - ruby: 3.2 + - ruby: 3.3 gemfile: Gemfile - postgres: 10 + rails_version: 7.2 + - ruby: 3.2 + gemfile: gemfiles/Gemfile-7-1 rails_version: 7.1 - ruby: 3.2 gemfile: gemfiles/Gemfile-7-0 - postgres: 10 rails_version: 7.0 - ruby: 2.7 gemfile: gemfiles/Gemfile-6-1 - postgres: 10 rails_version: 6.1 - - ruby: 2.6 - gemfile: gemfiles/Gemfile-6-0 - postgres: 10 - rails_version: 6.0 - - ruby: 2.6 - gemfile: gemfiles/Gemfile-5-2 - postgres: 10 - rails_version: 5.0 env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} USE_OFFICIAL_GEM_SOURCE: 1 RAILS_VERSION: ${{ matrix.rails_version }} + DATABASE_URL: postgres://postgres:123456@localhost:5432/action-store-test steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - uses: ankane/setup-postgres@v1 - with: - postgres-version: ${{ matrix.postgres }} - - run: createdb action-store-test - run: bundle exec rails test diff --git a/.gitignore b/.gitignore index 1642439..6cc6007 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /test/version_tmp/ /tmp/ test/dummy/log/**/* +test/dummy/tmp/**/* # Used by dotenv library to load environment variables. # .env diff --git a/DEVELOPMENT b/DEVELOPMENT new file mode 100644 index 0000000..80646c9 --- /dev/null +++ b/DEVELOPMENT @@ -0,0 +1,26 @@ +# DEVELOPMENT GUIDE + +```bash +docker-compose up -d +``` + +Create local datebase + +```bash +bundle install +rails db:create db:migrate +``` + +Run tests + +```bash +rails test +``` + +## Publish new RubyGem version + +- Update version in `lib/action_store/version.rb` +- Run `bundle install`. +- Create a new tag in the format `vX.X.X` and push it to the repository. +- Run `rake release` to publish the new version to RubyGems. +- Write release notes in GitHub releases: https://github.com/rails-engine/action-store/releases diff --git a/Gemfile b/Gemfile index b4f90c5..fecebb7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,4 @@ source "https://rubygems.org" gemspec -gem "rails", "~> 7.1.0" +gem "rails", "~> 7.2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 3cdb5d6..0a9825a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,100 +7,97 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.1.1) - actionpack (= 7.1.1) - activesupport (= 7.1.1) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.1) - actionpack (= 7.1.1) - activejob (= 7.1.1) - activerecord (= 7.1.1) - activestorage (= 7.1.1) - activesupport (= 7.1.1) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.1) - actionpack (= 7.1.1) - actionview (= 7.1.1) - activejob (= 7.1.1) - activesupport (= 7.1.1) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.1) - actionview (= 7.1.1) - activesupport (= 7.1.1) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) - rack (>= 2.2.4) + racc + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.1) - actionpack (= 7.1.1) - activerecord (= 7.1.1) - activestorage (= 7.1.1) - activesupport (= 7.1.1) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.1) - activesupport (= 7.1.1) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.1) - activesupport (= 7.1.1) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.1) - activesupport (= 7.1.1) - activerecord (7.1.1) - activemodel (= 7.1.1) - activesupport (= 7.1.1) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.1) - actionpack (= 7.1.1) - activejob (= 7.1.1) - activerecord (= 7.1.1) - activesupport (= 7.1.1) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.1) + activesupport (7.2.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - base64 (0.1.1) - bigdecimal (3.1.4) - builder (3.2.4) - concurrent-ruby (1.2.2) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + base64 (0.2.0) + bigdecimal (3.1.8) + builder (3.3.0) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) - drb (2.1.1) - ruby2_keywords - erubi (1.12.0) + date (3.3.4) + drb (2.2.1) + erubi (1.13.0) factory_bot (6.2.0) activesupport (>= 5.0.0) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.1) + i18n (1.14.6) concurrent-ruby (~> 1.0) - io-console (0.6.0) - irb (1.8.1) - rdoc - reline (>= 0.3.8) - loofah (2.21.4) + io-console (0.7.2) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.6.1) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -108,29 +105,28 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) mini_mime (1.1.5) - mini_portile2 (2.8.4) - minitest (5.20.0) - mutex_m (0.1.2) - net-imap (0.4.1) + mini_portile2 (2.8.7) + minitest (5.25.1) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) + nio4r (2.7.3) + nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) pg (1.5.4) - psych (5.1.1) + psych (5.1.2) stringio - racc (1.7.1) - rack (3.0.8) + racc (1.8.1) + rack (3.1.7) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -138,20 +134,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.1) - actioncable (= 7.1.1) - actionmailbox (= 7.1.1) - actionmailer (= 7.1.1) - actionpack (= 7.1.1) - actiontext (= 7.1.1) - actionview (= 7.1.1) - activejob (= 7.1.1) - activemodel (= 7.1.1) - activerecord (= 7.1.1) - activestorage (= 7.1.1) - activesupport (= 7.1.1) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.1.1) + railties (= 7.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -159,30 +155,31 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.1) - actionpack (= 7.1.1) - activesupport (= 7.1.1) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) - rake (13.0.6) - rdoc (6.5.0) + rake (13.2.1) + rdoc (6.7.0) psych (>= 4.0.0) - reline (0.3.9) + reline (0.5.10) io-console (~> 0.5) - ruby2_keywords (0.0.5) - stringio (3.0.8) - thor (1.2.2) - timeout (0.4.0) + securerandom (0.3.1) + stringio (3.1.1) + thor (1.3.2) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + useragent (0.16.10) webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.12) + zeitwerk (2.6.18) PLATFORMS ruby @@ -191,7 +188,7 @@ DEPENDENCIES action-store! factory_bot pg - rails (~> 7.1.0) + rails (~> 7.2.0) BUNDLED WITH - 2.2.3 + 2.5.3 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..94bb593 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.1" + +services: + db: + image: postgres:latest + platform: linux/arm64 + restart: always + environment: + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_USER: postgres + volumes: + - ./tmp/postgresql:/var/lib/postgresql/data + ports: + - 54321:5432 diff --git a/gemfiles/Gemfile-6-0 b/gemfiles/Gemfile-6-0 deleted file mode 100644 index 04964f8..0000000 --- a/gemfiles/Gemfile-6-0 +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '..' - -gem 'rails', '~> 6.0.0' diff --git a/gemfiles/Gemfile-5-2 b/gemfiles/Gemfile-7-1 similarity index 68% rename from gemfiles/Gemfile-5-2 rename to gemfiles/Gemfile-7-1 index 54b384a..173bb3f 100644 --- a/gemfiles/Gemfile-5-2 +++ b/gemfiles/Gemfile-7-1 @@ -2,4 +2,4 @@ source 'https://rubygems.org' gemspec path: '..' -gem 'rails', '~> 5.2.0' +gem 'rails', '~> 7.1.0' diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml index 61dad29..84e217d 100644 --- a/test/dummy/config/database.yml +++ b/test/dummy/config/database.yml @@ -6,6 +6,9 @@ default: &default development: <<: *default database: action-store-development + host: localhost + port: 54321 + user: postgres # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". @@ -13,6 +16,9 @@ development: test: <<: *default database: action-store-test + host: localhost + port: 54321 + user: postgres production: <<: *default