From 2518fd544c780906341eeb9a72c50056af0f9542 Mon Sep 17 00:00:00 2001 From: iMacTia Date: Tue, 5 May 2020 19:30:45 +0100 Subject: [PATCH 1/5] Adds CI GitHub Action --- .../CODE_OF_CONDUCT.md | 0 .github/workflows/ci.yml | 56 +++++++++++++++++++ README.md | 2 +- lib/faraday/http.rb | 3 +- 4 files changed, 58 insertions(+), 3 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) create mode 100644 .github/workflows/ci.yml 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..4b3d39d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +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: | + source $HOME/.rvm/scripts/rvm + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Test + run: | + source $HOME/.rvm/scripts/rvm + bundle exec rake \ No newline at end of file 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 From 5715cfe22d165e54ad9f6d0d150e6935a7892dfb Mon Sep 17 00:00:00 2001 From: iMacTia Date: Tue, 5 May 2020 19:39:43 +0100 Subject: [PATCH 2/5] Fixes to Gemfile and .gitignore --- .gitignore | 1 + Gemfile | 7 +++++++ Gemfile.lock | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) 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 index 87746bd..1ae55a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,6 +67,8 @@ GEM rexml ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) + rubocop-performance (1.5.2) + rubocop (>= 0.71.0) ruby-progressbar (1.10.1) safe_yaml (1.0.5) simplecov (0.18.5) @@ -93,7 +95,8 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) rspec_junit_formatter (~> 0.4) - rubocop (~> 0.65) + rubocop (~> 0.82.0) + rubocop-performance (~> 1.0) simplecov webmock (~> 3.4) From 83993a964a32eaf665f61b2a3497dd0a210efbdd Mon Sep 17 00:00:00 2001 From: iMacTia Date: Tue, 5 May 2020 19:40:11 +0100 Subject: [PATCH 3/5] Removes Gemfile.lock from VCS --- Gemfile.lock | 104 --------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 1ae55a6..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,104 +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) - rubocop-performance (1.5.2) - rubocop (>= 0.71.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.82.0) - rubocop-performance (~> 1.0) - simplecov - webmock (~> 3.4) - -BUNDLED WITH - 2.1.4 From d583c26ecb04c6398e8d3a69a663c71549105d49 Mon Sep 17 00:00:00 2001 From: iMacTia Date: Tue, 5 May 2020 20:10:26 +0100 Subject: [PATCH 4/5] Fix CI workflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b3d39d..6a917fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,9 +40,9 @@ jobs: - uses: actions/checkout@v1 - name: Set up Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} - name: Build run: | From b67aefb9b7f06ab653c5378d0a710f98cdcc33a6 Mon Sep 17 00:00:00 2001 From: iMacTia Date: Tue, 5 May 2020 20:16:50 +0100 Subject: [PATCH 5/5] Fix CI workflow again --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a917fc..5ba64e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,11 +46,9 @@ jobs: - name: Build run: | - source $HOME/.rvm/scripts/rvm gem install bundler bundle install --jobs 4 --retry 3 - name: Test run: | - source $HOME/.rvm/scripts/rvm bundle exec rake \ No newline at end of file