diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a022833 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,113 @@ +name: tests + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - ruby: "2.4" + rails: ~> 4.2.0 + - ruby: "2.4" + rails: ~> 5.0.0 + - ruby: "2.4" + rails: ~> 5.1.0 + - ruby: "2.4" + rails: ~> 5.2.0 + + - ruby: "2.5" + rails: ~> 5.0.0 + - ruby: "2.5" + rails: ~> 5.1.0 + - ruby: "2.5" + rails: ~> 5.2.0 + - ruby: "2.5" + rails: ~> 6.0.0 + - ruby: "2.5" + rails: ~> 6.1.0 + + - ruby: "2.6" + rails: ~> 5.0.0 + - ruby: "2.6" + rails: ~> 5.1.0 + - ruby: "2.6" + rails: ~> 5.2.0 + - ruby: "2.6" + rails: ~> 6.0.0 + - ruby: "2.6" + rails: ~> 6.1.0 + + - ruby: "2.7" + rails: ~> 5.0.0 + - ruby: "2.7" + rails: ~> 5.1.0 + - ruby: "2.7" + rails: ~> 5.2.0 + - ruby: "2.7" + rails: ~> 6.0.0 + - ruby: "2.7" + rails: ~> 6.1.0 + - ruby: "2.7" + rails: ~> 7.0.0 + - ruby: "2.7" + rails: ~> 7.1.0 + - ruby: "2.7" + rails: edge + + - ruby: "3.0" + rails: ~> 6.0.0 + - ruby: "3.0" + rails: ~> 6.1.0 + - ruby: "3.0" + rails: ~> 7.0.0 + - ruby: "3.0" + rails: ~> 7.1.0 + - ruby: "3.0" + rails: edge + + - ruby: "3.1" + rails: ~> 6.0.0 + - ruby: "3.1" + rails: ~> 6.1.0 + - ruby: "3.1" + rails: ~> 7.0.0 + - ruby: "3.1" + rails: ~> 7.1.0 + - ruby: "3.1" + rails: edge + + - ruby: "3.2" + rails: ~> 6.0.0 + - ruby: "3.2" + rails: ~> 6.1.0 + - ruby: "3.2" + rails: ~> 7.0.0 + - ruby: "3.2" + rails: ~> 7.1.0 + - ruby: "3.2" + rails: edge + + - ruby: head + rails: ~> 6.0.0 + - ruby: head + rails: ~> 6.1.0 + - ruby: head + rails: ~> 7.0.0 + - ruby: head + rails: ~> 7.1.0 + - ruby: head + rails: edge + + env: + RAILS_VERSION: ${{ matrix.rails }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run tests + run: bundle exec rake diff --git a/Gemfile b/Gemfile index bc6069d..7d3b0d9 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,17 @@ source "https://rubygems.org" # rubocop:disable Bundler/DuplicatedGem if ENV["RAILS_VERSION"] - gem "rails", ENV["RAILS_VERSION"] -elsif ENV["RAILS_BRANCH"] - gem "rails", git: "https://github.com/rails/rails.git", branch: ENV["RAILS_BRANCH"] + if ENV["RAILS_VERSION"] == "edge" + gem "rails", git: "https://github.com/rails/rails.git", branch: "main" + else + gem "rails", ENV["RAILS_VERSION"] + end end # rubocop:enable Bundler/DuplicatedGem +# Lock loofah to old version for Ruby 2.4 +unless RUBY_VERSION > 2.5 + gem "loofah", "~> 2.20.0" +end + gemspec