From 15f4e1ec2dc10a7ea82ad7bcc2a5eb04f4726b64 Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Wed, 10 Feb 2021 11:56:06 -0500 Subject: [PATCH] Use Github Actions for CI --- .github/workflows/CI.yml | 37 +++++++++++++++++++++++++++++++++++++ Gemfile | 2 +- Rakefile | 14 ++++++++++++-- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..8038859a9 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - head + - '3.0' + - '2.7' + - '2.6' + - '2.5' + - jruby + continue-on-error: ${{ matrix.ruby == 'head' }} + name: Ruby ${{ matrix.ruby }} + env: + JRUBY_OPTS: "--debug" + steps: + - uses: actions/checkout@v2 + - name: Install Apt Packages + run: | + sudo apt-get install libcurl4-openssl-dev -y + - uses: ruby/setup-ruby@v1 + continue-on-error: true + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: | + bundle exec rake diff --git a/Gemfile b/Gemfile index f9b31b19c..0130a9232 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'http://rubygems.org/' +source 'https://rubygems.org/' gemspec diff --git a/Rakefile b/Rakefile index 56b26ff0e..b26237955 100644 --- a/Rakefile +++ b/Rakefile @@ -3,24 +3,34 @@ Bundler::GemHelper.install_tasks require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"] + t.rspec_opts = %w[ + --force-color + --format progress + --require ./spec/spec_helper.rb + ] t.pattern = 'spec/**/*_spec.rb' end RSpec::Core::RakeTask.new(:spec_http_without_webmock) do |t| - t.rspec_opts = ["-c", "-f progress", "-r ./spec/acceptance/net_http/real_net_http_spec.rb"] + t.rspec_opts = %w[ + --force-color + --format progress + --require ./spec/acceptance/net_http/real_net_http_spec.rb + ] t.pattern = 'spec/acceptance/net_http/real_net_http_spec.rb' end require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.test_files = FileList["test/**/*.rb"].exclude("test/test_helper.rb") + test.options = "--use-color" test.verbose = false test.warning = false end Rake::TestTask.new(:minitest) do |test| test.test_files = FileList["minitest/**/*.rb"].exclude("test/test_helper.rb") + test.options = "--pride" test.verbose = false test.warning = false end