Skip to content

Commit

Permalink
Merge pull request #1 from saiqulhaq/gh-action
Browse files Browse the repository at this point in the history
  • Loading branch information
saiqulhaq authored Nov 6, 2021
2 parents 26a0541 + 19bd494 commit 63da574
Show file tree
Hide file tree
Showing 23 changed files with 367 additions and 443 deletions.
27 changes: 4 additions & 23 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,12 @@
# For more details, see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform

# For a list of all available engines, see here:
# http://docs.codeclimate.com/article/296-engines-available-engines

engines:
# to turn on an engine, add it here and set enabled to `true`
# to turn off an engine, set enabled to `false` or remove it
plugins:
bundler-audit:
enabled: true
rubocop:
enabled: true
# golint:
# enabled: true
# gofmt:
# enabled: true
# eslint:
# enabled: true
# csslint:
# enabled: true

# Engines can analyze files and report issues on them, but you can separately
# decide which files will receive ratings based on those issues. This is
# specified by path patterns under the ratings key.

# For more details see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform

# Note: If the ratings key is not specified, this will result in a 0.0 GPA on your dashboard.
channel: rubocop-1-22-3

ratings:
paths:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Ruby

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.5', '2.6', '2.7', '3.0']

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rspec
146 changes: 0 additions & 146 deletions .rubocop.yml

This file was deleted.

6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source "https://rubygems.org"
# frozen_string_literal: true

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in case_transform2.gemspec
gemspec
81 changes: 67 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,54 @@
PATH
remote: .
specs:
case_transform2 (1.0.0)
case_transform2 (1.1.0)

GEM
remote: https://rubygems.org/
specs:
coderay (1.1.1)
ast (2.4.2)
coderay (1.1.3)
diff-lcs (1.3)
docile (1.3.0)
json (2.1.0)
method_source (0.8.2)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rake (11.2.2)
ffi (1.15.4)
formatador (0.3.0)
guard (2.18.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.13.0)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
json (2.6.1)
listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
method_source (1.0.0)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.21.0)
parser (3.0.2.0)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rainbow (3.0.0)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
Expand All @@ -29,23 +62,43 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
rubocop (1.22.3)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.12.0)
parser (>= 3.0.1.1)
rubocop-rspec (2.5.0)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
shellany (0.0.1)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slop (3.6.0)
thor (1.1.0)
unicode-display_width (2.1.0)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.16)
bundler (>= 2.2.30)
case_transform2!
pry (~> 0.10.4)
rake (~> 11.2.2)
guard
guard-rspec
pry
rake
rspec (~> 3.7.0)
rubocop (~> 1.22)
rubocop-rspec
simplecov (~> 0.16.1)

BUNDLED WITH
1.16.2
2.2.30
38 changes: 6 additions & 32 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}

## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
Expand All @@ -15,7 +17,7 @@
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# NOTE: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
Expand All @@ -24,8 +26,8 @@
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

guard :rspec, cmd: "bundle exec rspec" do
require "guard/rspec/dsl"
guard :rspec, cmd: 'bundle exec rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)

# Feel free to open issues for suggestions and improvements
Expand All @@ -39,32 +41,4 @@ guard :rspec, cmd: "bundle exec rspec" do
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)

# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)

watch(rails.controllers) do |m|
[
rspec.spec.call("routing/#{m[1]}_routing"),
rspec.spec.call("controllers/#{m[1]}_controller"),
rspec.spec.call("acceptance/#{m[1]}")
]
end

# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }

# Capybara features specs
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end
end
Loading

0 comments on commit 63da574

Please sign in to comment.