Skip to content

Commit

Permalink
Switch CI to GitHub actions and Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhoward committed Dec 31, 2020
1 parent 05a0ee6 commit 2b671f6
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 53 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: CI
on:
push:
tags: ['v*']
branches: [master]
pull_request:
branches: ['**']
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, jruby-9.2.10, truffleruby-20.2.0]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rubocop
if: matrix.ruby == '2.7'
- run: bundle exec rspec --format doc
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/lcov
- run: bin/check-version

release:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{secrets.RUBYGEMS_API_KEY}}
14 changes: 10 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@ AllCops:

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Lint/MissingCopEnableDirective:
Enabled: false
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true

Metrics/BlockLength:
Exclude:
- spec/*

Style/Documentation:
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in strudel.gemspec
gemspec

not_jruby = %i[ruby mingw x64_mingw].freeze

gem 'bundler', '>= 1.17', '< 3'
gem 'byebug', platforms: not_jruby
gem 'irb', '~> 1.0'
gem 'redcarpet', '~> 3.5', platforms: not_jruby
gem 'simplecov', '>= 0.17.1'
# 0.8 is incompatible with simplecov < 0.18
gem 'simplecov-lcov', '~> 0.7', '< 0.8'
gem 'yard', '~> 0.9.26', platforms: not_jruby
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Strudel

[![Gem Version](https://badge.fury.io/rb/strudel.svg)](https://badge.fury.io/rb/strudel)
[![Build Status](https://travis-ci.org/justinhoward/strudel.svg?branch=master)](https://travis-ci.org/justinhoward/strudel)
[![Code Climate](https://codeclimate.com/github/justinhoward/strudel/badges/gpa.svg)](https://codeclimate.com/github/justinhoward/strudel)
[![Test Coverage](https://codeclimate.com/github/justinhoward/strudel/badges/coverage.svg)](https://codeclimate.com/github/justinhoward/strudel)
[![CI](https://github.com/justinhoward/strudel/workflows/CI/badge.svg)](https://github.com/justinhoward/strudel/actions?query=workflow%3ACI+branch%3Amaster)
[![Codacy](https://app.codacy.com/project/badge/Grade/79b0e9d0f90c44f2baca0ea4f076ae3a)](https://www.codacy.com/gh/justinhoward/strudel/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=justinhoward/strudel&amp;utm_campaign=Badge_Grade)
[![Inline docs](http://inch-ci.org/github/justinhoward/strudel.svg?branch=master)](http://inch-ci.org/github/justinhoward/strudel)

Strudel is a dependency injection container for Ruby. It's a way to organize
Expand Down
9 changes: 9 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'strudel'
require 'byebug' if Gem.loaded_specs['byebug']
require 'irb'

IRB.start
21 changes: 18 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# frozen_string_literal: true

require 'simplecov'
SimpleCov.start if ENV['COVERAGE']
require 'byebug' if Gem.loaded_specs['byebug']

if ENV['COVERAGE'] || ENV['CI']
require 'simplecov'
if ENV['CI']
require 'simplecov-lcov'
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
end

SimpleCov.start do
if Gem::Version.new(SimpleCov::VERSION) >= Gem::Version.new('0.18.0')
enable_coverage :branch
end
add_filter '/spec/'
add_filter '/vendor/'
end
end

require 'strudel'

Expand All @@ -17,5 +32,5 @@

config.disable_monkey_patching!

config.warnings = true
config.warnings = false
end
4 changes: 1 addition & 3 deletions strudel.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ['lib']

spec.add_development_dependency 'redcarpet', '~> 3.4'
spec.add_development_dependency 'rspec', '~> 3.4'
# 0.81 is the last rubocop version with Ruby 2.3 support
spec.add_development_dependency 'rubocop', '0.81.0'
spec.add_development_dependency 'simplecov', '~> 0.11'
spec.add_development_dependency 'yard', '>= 0.9.11'
spec.add_development_dependency 'rubocop-rspec', '1.38.1'
end

0 comments on commit 2b671f6

Please sign in to comment.