Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: CI
on:
pull_request:
push:
branches: [ main ]
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -23,33 +23,37 @@ jobs:

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rails-version: ["rails-7-1", "rails-7-2", "rails-8-0"]

# services:
# redis:
# image: redis
# ports:
# - 6379:6379
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.4.5
bundler-cache: true
ruby-version: "3.3"
bundler-cache: false

- name: Install dependencies
run: bundle install

- name: Generate Appraisal gemfiles
run: bundle exec appraisal install

- name: Run tests
run: bundle exec rspec
run: bundle exec appraisal ${{ matrix.rails-version }} rspec

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
name: screenshots-${{ matrix.rails-version }}
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
16 changes: 16 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Appraisals file for testing against multiple Rails versions

appraise "rails-7-1" do
gem "rails", "~> 7.1.0"
gem "activestorage", "~> 7.1.0"
end

appraise "rails-7-2" do
gem "rails", "~> 7.2.0"
gem "activestorage", "~> 7.2.0"
end

appraise "rails-8-0" do
gem "rails", "~> 8.0.0"
gem "activestorage", "~> 8.0.0"
end
49 changes: 39 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
fileboost (0.2.0.pre2)
activestorage (>= 6.0)
activestorage (>= 7.1)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -78,6 +78,10 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
Expand Down Expand Up @@ -129,10 +133,22 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.9-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.18.9-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.18.9-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-musl)
racc (~> 1.4)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
Expand All @@ -148,7 +164,7 @@ GEM
psych (5.2.6)
date
stringio
puma (7.0.1)
puma (7.0.2)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.1)
Expand Down Expand Up @@ -247,16 +263,22 @@ GEM
rubocop-rails (>= 2.30)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sqlite3 (2.7.3-aarch64-linux-gnu)
sqlite3 (2.7.3-aarch64-linux-musl)
sqlite3 (2.7.3-arm-linux-gnu)
sqlite3 (2.7.3-arm-linux-musl)
sqlite3 (2.7.3-arm64-darwin)
sqlite3 (2.7.3-x86_64-darwin)
sqlite3 (2.7.3-x86_64-linux-gnu)
sqlite3 (2.7.3-x86_64-linux-musl)
stringio (3.1.7)
thor (1.4.0)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.5)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uri (1.0.3)
useragent (0.16.11)
websocket-driver (0.8.0)
Expand All @@ -266,21 +288,28 @@ GEM
zeitwerk (2.7.3)

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86_64-linux
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bundler (~> 2)
appraisal (~> 2.5)
bundler (>= 2.1, < 2.7)
combustion (~> 1)
fileboost!
propshaft
puma
rails (~> 8.0.0)
rails (>= 7.1)
rake (~> 13.0)
rspec (~> 3.0)
rspec-rails (~> 6.0)
rubocop-rails-omakase
sqlite3 (~> 2.0, >= 0)
sqlite3

BUNDLED WITH
2.7.1
2.6.9
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Fileboost is a Rails gem that provides seamless integration with the Fileboost.d
## Table of Contents

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
Expand Down Expand Up @@ -38,6 +39,12 @@ Fileboost is a Rails gem that provides seamless integration with the Fileboost.d
- 🔧 **Simple configuration** - just project ID and token required
- 🔄 **Automatic fallback** - non-ActiveStorage images work exactly as before

## Requirements

- Ruby 3.0+
- Rails 7.1+
- ActiveStorage

## Installation

Register an account at [Fileboost.dev](https://fileboost.dev) and obtain your project ID and token.
Expand Down
20 changes: 20 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ require "bundler/setup"
require "bundler/gem_tasks"
require "rspec/core/rake_task"

begin
require "appraisal"
rescue LoadError
# Appraisal not available
end

RSpec::Core::RakeTask.new(:spec)

task default: :spec

namespace :test do
desc "Run tests against all Rails versions"
task :all do
sh "bundle exec appraisal install"
sh "bundle exec appraisal rspec"
end

desc "Run tests against specific Rails version (e.g. rake test:rails[7-1])"
task :rails, [ :version ] do |t, args|
version = args[:version] || "7-2"
sh "bundle exec appraisal rails-#{version} rspec"
end
end
7 changes: 4 additions & 3 deletions fileboost.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = ">= 3.0"

spec.add_runtime_dependency "activestorage", ">= 6.0"
spec.add_runtime_dependency "activestorage", ">= 7.1"

spec.add_development_dependency "bundler", "~> 2"
spec.add_development_dependency "appraisal", "~> 2.5"
spec.add_development_dependency "bundler", ">= 2.1", "< 2.7"
spec.add_development_dependency "combustion", "~> 1"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rails", "~> 8.0.0"
spec.add_development_dependency "rails", ">= 7.1"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rspec-rails", "~> 6.0"
spec.add_development_dependency "sqlite3", "~> 2.0"
Expand Down
12 changes: 12 additions & 0 deletions gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "puma"
gem "sqlite3"
gem "propshaft"
gem "rubocop-rails-omakase", require: false
gem "rails", "~> 7.1.0"
gem "activestorage", "~> 7.1.0"

gemspec path: "../"
Loading