diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ba64e6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + pull_request: + + push: + branches: [master] + +env: + GIT_COMMIT_SHA: ${{ github.sha }} + GIT_BRANCH: ${{ github.ref }} + +jobs: + linting: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Set up Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.7.x + + - name: Rubocop + run: | + gem install bundler + bundle config set without 'development test' + bundle config set with 'lint' + bundle install + bundle exec rubocop --format progress + build: + needs: [linting] + runs-on: ubuntu-latest + strategy: + matrix: + ruby: ['2.4', '2.5', '2.6', '2.7'] + + steps: + - uses: actions/checkout@v1 + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Build + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Test + run: | + bundle exec rake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0bcdfc6..a1ef8bf 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ tmp ## BUNDLER *.gem .bundle +Gemfile.lock vendor/bundle ## IDEs diff --git a/Gemfile b/Gemfile index 8b1572a..a990bc9 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,11 @@ gemspec gem 'faraday', git: 'https://github.com/lostisland/faraday.git', branch: 'master' + +# Required gems to run all Faraday tests gem 'multipart-parser' + +group :lint, :development do + gem 'rubocop', '~> 0.82.0' + gem 'rubocop-performance', '~> 1.0' +end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 87746bd..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,101 +0,0 @@ -GIT - remote: https://github.com/lostisland/faraday.git - revision: 87ecaf96822ef03ef6e86a9b9b57caa97e4c0fa8 - branch: master - specs: - faraday (1.0.1) - multipart-post (>= 1.2, < 3) - -PATH - remote: . - specs: - faraday-http (0.1.0) - http (~> 3.0) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - ast (2.4.0) - crack (0.4.3) - safe_yaml (~> 1.0.0) - diff-lcs (1.3) - docile (1.3.2) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - hashdiff (1.0.1) - http (3.3.0) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 2.0) - http_parser.rb (~> 0.6.0) - http-cookie (1.0.3) - domain_name (~> 0.5) - http-form_data (2.3.0) - http_parser.rb (0.6.0) - jaro_winkler (1.5.4) - multipart-parser (0.1.1) - multipart-post (2.1.1) - parallel (1.19.1) - parser (2.7.1.2) - ast (~> 2.4.0) - public_suffix (4.0.4) - rainbow (3.0.0) - rake (13.0.1) - rexml (3.2.4) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.3) - rspec_junit_formatter (0.4.1) - rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.82.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.7.0.1) - rainbow (>= 2.2.2, < 4.0) - rexml - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - ruby-progressbar (1.10.1) - safe_yaml (1.0.5) - simplecov (0.18.5) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov-html (0.12.2) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.7) - unicode-display_width (1.7.0) - webmock (3.8.3) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (~> 2.0) - faraday! - faraday-http! - multipart-parser - rake (~> 13.0) - rspec (~> 3.0) - rspec_junit_formatter (~> 0.4) - rubocop (~> 0.65) - simplecov - webmock (~> 3.4) - -BUNDLED WITH - 2.1.4 diff --git a/README.md b/README.md index 6fff0af..e30953c 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,4 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the Faraday::Http project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lostisland/faraday-http/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Faraday::Http project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lostisland/faraday-http/blob/master/.github/CODE_OF_CONDUCT.md). diff --git a/lib/faraday/http.rb b/lib/faraday/http.rb index c159e95..e8558ad 100644 --- a/lib/faraday/http.rb +++ b/lib/faraday/http.rb @@ -8,8 +8,7 @@ module Faraday module Http class Error < StandardError; end - # Your code goes here... end - Faraday::Adapter.register_middleware http: Faraday::Adapter::HTTP + Faraday::Adapter.register_middleware(http: Faraday::Adapter::HTTP) end