Skip to content

Commit

Permalink
ci: test against old versions of Nokogiri and Loofah
Browse files Browse the repository at this point in the history
to maintain backwards compatibility for a while longer
  • Loading branch information
flavorjones committed May 20, 2023
1 parent 4491ec8 commit d5ac27e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ jobs:
bundler-cache: true
- run: bundle exec rake

cruby-old-dependencies:
runs-on: ubuntu-latest
env:
TEST_WITH_OLD_DEPENDENCIES: t
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.5"
bundler-cache: true
- run: bundle exec rake

cruby-nokogiri-system-libraries:
runs-on: ubuntu-20.04
steps:
Expand Down
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ group :rubocop do
gem "rubocop-rails", require: false
end

# specify gem versions for old rubies
gem "nokogiri", RUBY_VERSION < "2.1" ? "~> 1.6.0" : ">= 1.7"
gem "activesupport", RUBY_VERSION < "2.2.2" ? "~> 4.2.0" : ">= 5"
if ENV["TEST_WITH_OLD_DEPENDENCIES"]
gem "nokogiri", "< 1.12.0"
gem "loofah", "< 2.21.0"
end
3 changes: 2 additions & 1 deletion test/sanitizer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
require "minitest/autorun"
require "rails-html-sanitizer"

puts Nokogiri::VERSION_INFO
puts "nokogiri version info: #{Nokogiri::VERSION_INFO}"
puts "html5 support: #{Rails::HTML::Sanitizer.html5_support?}"

#
# NOTE that many of these tests contain multiple acceptable results.
Expand Down

0 comments on commit d5ac27e

Please sign in to comment.