diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cd31747 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ruby: ["3.0", "3.1", "3.2"] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Rake + run: bundle exec rake + + - name: Archive SimpleCov Report + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 606a54e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.6 - - 2.7 - - 3.0 -before_install: - - gem update --system --no-doc -script: - - bundle exec rspec - - bundle exec rubocop diff --git a/Gemfile b/Gemfile index fba6b0e..c6cf42a 100644 --- a/Gemfile +++ b/Gemfile @@ -11,3 +11,7 @@ group :development do # TODO: Move to gemspec when hanami-view 2.0 is available gem 'hanami-view', github: 'hanami/view', tag: 'v2.1.0.beta2' end + +group :test do + gem 'simplecov', require: false +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 675fd10..3ddc992 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,15 @@ require 'web_pipe' require 'pry-byebug' +require "simplecov" + +unless ENV["NO_COVERAGE"] + SimpleCov.start do + add_filter %r{^/spec/} + enable_coverage :branch + enable_coverage_for_eval + end +end # https://github.com/dry-rb/dry-configurable/issues/70 WebPipe.load_extensions(