Skip to content

Commit 1a04c60

Browse files
authored
Merge pull request #17 from larskanis/update-pg
Allow use if pg-1.4.6+ and add Github Action CI to verify that it works
2 parents b07df4c + 2288eb4 commit 1a04c60

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ci
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
ci:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ ubuntu, macos, windows ]
12+
ruby: [ '2.5', ruby-head ]
13+
runs-on: ${{ matrix.os }}-latest
14+
env:
15+
PGSERVICE: postgres
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ matrix.ruby }}
22+
- uses: ikalnytskyi/action-setup-postgres@v4
23+
24+
- run: bundle install
25+
- run: createdb activestorage_pglo_test
26+
27+
# For some reason the db migrations needs to be executed explicitly on Windows
28+
- name: Copy and run migrations on Windows
29+
if: matrix.os == 'windows'
30+
run: |
31+
ridk exec cp -rv db/migrate test/dummy/db/
32+
rake -f test/dummy/Rakefile active_storage:install db:migrate RAILS_ENV=test
33+
- run: bundle exec rake test

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ gem 'image_processing', '~> 1.2'
1414

1515
# To use a debugger
1616
# gem 'byebug', group: [:development, :test]
17+
18+
# Required on Windows only
19+
gem 'tzinfo-data'

active_storage-postgresql.gemspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Gem::Specification.new do |s|
1616
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
1717

1818
s.add_dependency "rails", ">= 6.0"
19-
s.add_dependency "pg", ">= 1.0", "< 1.3"
19+
s.add_dependency "pg", ">= 1.0", "< 2.0",
20+
# Avoid incompatible pg versions, see: https://github.com/ged/ruby-pg/pull/498
21+
"!= 1.3.0", "!= 1.3.1", "!= 1.3.2", "!= 1.3.3", "!= 1.3.4", "!= 1.3.5",
22+
"!= 1.4.0", "!= 1.4.1", "!= 1.4.2", "!= 1.4.3", "!= 1.4.4", "!= 1.4.5"
2023

2124
s.add_development_dependency "pry", "~> 0.11"
2225
s.add_development_dependency "database_cleaner", "~> 1.7"

0 commit comments

Comments
 (0)