Skip to content

Commit

Permalink
Switch to GH Actions for CI and add coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
waiting-for-dev committed Oct 26, 2023
1 parent ffecd9e commit 7a15d30
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 12 deletions.
32 changes: 32 additions & 0 deletions .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
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -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
7 changes: 6 additions & 1 deletion Rakefile
Expand Up @@ -2,7 +2,12 @@

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

task default: :spec
desc 'Run code quality checks'
task lint: %i[rubocop]

task default: %i[lint spec]
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -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(
Expand Down

0 comments on commit 7a15d30

Please sign in to comment.