From ebbbab5c2eb4346dc2453967655f9bdd594ac8af Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Sat, 28 Nov 2020 00:24:02 -0800 Subject: [PATCH] test against ruby head (#1208) * CI: add "head" Ruby to matrix * Gemfile: Allow Ruby 3 to use net-http-client 4.x * Gemfile: Select net-http-persistent 4 differently Check for Ruby version 3+ * Gemfile: doc net-http-persistent has no gemspec * redo Co-authored-by: Olle Jonsson Co-authored-by: Olle Jonsson --- .github/workflows/ci.yml | 12 ++++++++---- Gemfile | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8776fa1f0..d0294cba6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,9 +39,15 @@ jobs: build: needs: [linting] runs-on: ubuntu-latest + name: build ${{ matrix.ruby }} strategy: + fail-fast: false matrix: ruby: ['2.4', '2.5', '2.6', '2.7'] + experimental: [false] + include: + - ruby: head + experimental: true steps: - uses: actions/checkout@v1 @@ -49,12 +55,10 @@ jobs: with: ruby-version: ${{ matrix.ruby }} - - name: Install dependencies run: | sudo apt-get install libcurl4-openssl-dev - - name: Build run: | sudo apt-get install libcurl4-openssl-dev @@ -62,6 +66,6 @@ jobs: bundle install --jobs 4 --retry 3 - name: Test - run: | - bundle exec rake + continue-on-error: ${{ matrix.experimental }} + run: bundle exec rake diff --git a/Gemfile b/Gemfile index 8c6f3b4ac..5bc51036b 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,9 @@ group :test, :development do gem 'excon', '>= 0.27.4' gem 'httpclient', '>= 2.2' gem 'multipart-parser' - gem 'net-http-persistent', '~> 3.0' + # TODO: remove this once v4 is released + options = (RUBY_VERSION.start_with?('3') ? { github: 'grosser/net-http-persistent', branch: 'grosser/spec' } : {}) + gem 'net-http-persistent', (RUBY_VERSION.start_with?('3') ? '>= 3.0' : '~> 3.0'), **options gem 'patron', '>= 0.4.2', platforms: :ruby gem 'rack-test', '>= 0.6', require: 'rack/test' gem 'rspec', '~> 3.7'