From 73458ac730d255360b6b98ea0dee996c01f64430 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Sun, 31 Oct 2021 23:50:16 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=91=B7=20Switch=20to=20GitHub=20Actio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Closes #202 Signed-off-by: Peter Boling --- .github/dependabot.yml | 8 +++++ .github/workflows/supported.yml | 57 +++++++++++++++++++++++++++++++ .github/workflows/unsupported.yml | 37 ++++++++++++++++++++ .simplecov | 5 +++ .travis.yml | 19 ----------- oauth.gemspec | 4 +-- test/test_helper.rb | 8 ++--- 7 files changed, 113 insertions(+), 25 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/supported.yml create mode 100644 .github/workflows/unsupported.yml create mode 100644 .simplecov delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..969b6a83 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + time: "04:30" + open-pull-requests-limit: 10 \ No newline at end of file diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml new file mode 100644 index 00000000..87a579c5 --- /dev/null +++ b/.github/workflows/supported.yml @@ -0,0 +1,57 @@ +name: Supported Rubies + +on: + push: + branches: + - master + - '*-maintenance' + - '*-dev' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + +jobs: + test: + name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + strategy: + fail-fast: false + matrix: + ruby: + - truffleruby-head + - ruby-head + - 3.0 + - 2.7 + - 2.6 + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }} + steps: + - uses: amancevice/setup-code-climate@v0 + name: CodeClimate Install + if: matrix.ruby == '2.6' && github.event_name != 'pull_request' + with: + cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }} + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Ruby & Bundle + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: CodeClimate Pre-build Notification + run: cc-test-reporter before-build + if: matrix.ruby == '2.6' && github.event_name != 'pull_request' + continue-on-error: ${{ matrix.allow_failures != 'false' }} + - name: Run tests + run: bundle exec rake test + - uses: codecov/codecov-action@v2 + with: + flags: unittests + name: codecov-upload + fail_ci_if_error: true + - name: CodeClimate Post-build Notification + run: cc-test-reporter after-build + if: matrix.ruby == '2.6' && github.event_name != 'pull_request' && always() + continue-on-error: ${{ matrix.allow_failures != 'false' }} diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml new file mode 100644 index 00000000..0c346b4a --- /dev/null +++ b/.github/workflows/unsupported.yml @@ -0,0 +1,37 @@ +name: Unsupported Rubies + +on: + push: + branches: + - master + - '*-maintenance' + - '*-dev' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + +jobs: + test: + name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + strategy: + fail-fast: false + matrix: + ruby: + - 2.5 + - 2.4 + - 2.3 + runs-on: ubuntu-18.04 + continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Ruby & Bundle + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run tests + run: bundle exec rake test diff --git a/.simplecov b/.simplecov new file mode 100644 index 00000000..94a1c1e8 --- /dev/null +++ b/.simplecov @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +SimpleCov.start do + add_filter "/spec/" +end diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4495e412..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: ruby - -rvm: -- "ruby-head" -- "2.7" -- "2.6" -- "2.5" -- "2.4" -- "2.3" -- "2.2" -matrix: - allow_failures: - - rvm: "ruby-head" -addons: - code_climate: - repo_token: 8f697ca756250f0c2c54170ae27e8a9c459d18a0236903b11291c88291b3aac9 - -after_success: - - bundle exec codeclimate-test-reporter diff --git a/oauth.gemspec b/oauth.gemspec index 84597698..7cd88a3e 100644 --- a/oauth.gemspec +++ b/oauth.gemspec @@ -45,7 +45,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency("em-http-request", "~> 1.1.7") spec.add_development_dependency("curb") spec.add_development_dependency("webmock", "< 2.0") - spec.add_development_dependency("codeclimate-test-reporter") - spec.add_development_dependency("simplecov") spec.add_development_dependency("rest-client") + spec.add_development_dependency("simplecov") + spec.add_development_dependency("simplecov-cobertura", "~> 1.4") end diff --git a/test/test_helper.rb b/test/test_helper.rb index fe77743a..cae9399e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,10 +2,10 @@ ENV['RACK_ENV'] = 'test' -# simplecov, Travis will call codeclimate - -require 'simplecov' -SimpleCov.start +# Code coverage +require "simplecov" +require "simplecov-cobertura" +SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter unless ENV["HTML_COVERAGE"] == "true" # require third-party code From 0d0d0b30dc6e6b679173531aa593f245b27b7977 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Sun, 31 Oct 2021 23:56:36 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=B7=20Install=20cURL=20Headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ref: https://github.com/actions/virtual-environments/issues/37#issuecomment-633663033 Signed-off-by: Peter Boling --- .github/workflows/supported.yml | 4 ++++ .github/workflows/unsupported.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml index 87a579c5..4ff8ef3f 100644 --- a/.github/workflows/supported.yml +++ b/.github/workflows/supported.yml @@ -35,6 +35,10 @@ jobs: cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }} - name: Checkout uses: actions/checkout@v2 + - name: Install cURL Headers + run: curl https://curl.haxx.se/download/curl-$V.tar.gz | sudo tar xz -C /usr --strip-components=1 curl-$V/include + env: + V: 7.58.0 - name: Setup Ruby & Bundle uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml index 0c346b4a..482bc764 100644 --- a/.github/workflows/unsupported.yml +++ b/.github/workflows/unsupported.yml @@ -28,6 +28,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Install cURL Headers + run: curl https://curl.haxx.se/download/curl-$V.tar.gz | sudo tar xz -C /usr --strip-components=1 curl-$V/include + env: + V: 7.58.0 - name: Setup Ruby & Bundle uses: ruby/setup-ruby@v1 with: From 819c9644fe60001873822259b7ebcdda14af44a2 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Mon, 1 Nov 2021 00:02:14 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=B7=20Install=20cURL=20Headers=20(?= =?UTF-8?q?more=20differently)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ref: https://github.com/actions/virtual-environments/issues/37#issue-506711317 Signed-off-by: Peter Boling --- .github/workflows/supported.yml | 4 +--- .github/workflows/unsupported.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml index 4ff8ef3f..8aef9282 100644 --- a/.github/workflows/supported.yml +++ b/.github/workflows/supported.yml @@ -36,9 +36,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Install cURL Headers - run: curl https://curl.haxx.se/download/curl-$V.tar.gz | sudo tar xz -C /usr --strip-components=1 curl-$V/include - env: - V: 7.58.0 + run: sudo apt-get install libcurl4-openssl-dev - name: Setup Ruby & Bundle uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml index 482bc764..c0e8a95b 100644 --- a/.github/workflows/unsupported.yml +++ b/.github/workflows/unsupported.yml @@ -29,9 +29,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Install cURL Headers - run: curl https://curl.haxx.se/download/curl-$V.tar.gz | sudo tar xz -C /usr --strip-components=1 curl-$V/include - env: - V: 7.58.0 + run: sudo apt-get install libcurl4-openssl-dev - name: Setup Ruby & Bundle uses: ruby/setup-ruby@v1 with: