diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7ff05a3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: ci +on: + push: + pull_request: + +jobs: + ci: + strategy: + fail-fast: false + matrix: + os: [ ubuntu, macos, windows ] + ruby: [ '2.5', ruby-head ] + runs-on: ${{ matrix.os }}-latest + env: + PGSERVICE: postgres + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: ikalnytskyi/action-setup-postgres@v4 + + - run: bundle install + - run: createdb activestorage_pglo_test + + # For some reason the db migrations needs to be executed explicitly on Windows + - name: Copy and run migrations on Windows + if: matrix.os == 'windows' + run: | + ridk exec cp -rv db/migrate test/dummy/db/ + rake -f test/dummy/Rakefile active_storage:install db:migrate RAILS_ENV=test + - run: bundle exec rake test diff --git a/Gemfile b/Gemfile index a946280..fa03efd 100644 --- a/Gemfile +++ b/Gemfile @@ -14,3 +14,6 @@ gem 'image_processing', '~> 1.2' # To use a debugger # gem 'byebug', group: [:development, :test] + +# Required on Windows only +gem 'tzinfo-data' diff --git a/active_storage-postgresql.gemspec b/active_storage-postgresql.gemspec index 9cff6f6..b1ae87c 100644 --- a/active_storage-postgresql.gemspec +++ b/active_storage-postgresql.gemspec @@ -16,7 +16,10 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] s.add_dependency "rails", ">= 6.0" - s.add_dependency "pg", ">= 1.0", "< 1.3" + s.add_dependency "pg", ">= 1.0", "< 2.0", + # Avoid incompatible pg versions, see: https://github.com/ged/ruby-pg/pull/498 + "!= 1.3.0", "!= 1.3.1", "!= 1.3.2", "!= 1.3.3", "!= 1.3.4", "!= 1.3.5", + "!= 1.4.0", "!= 1.4.1", "!= 1.4.2", "!= 1.4.3", "!= 1.4.4", "!= 1.4.5" s.add_development_dependency "pry", "~> 0.11" s.add_development_dependency "database_cleaner", "~> 1.7"