continus integration

This commit is contained in:
Miguel Savignano 2019-11-01 18:47:18 +01:00
parent 2560d0e230
commit 201bc7d913
9 changed files with 45 additions and 98 deletions

View File

@ -3,7 +3,7 @@ name: Rubocop
on: on:
pull_request: pull_request:
branches: branches:
- '*' - "*"
push: push:
branches: branches:
- master - master
@ -13,14 +13,14 @@ jobs:
name: Ruocop Action name: Ruocop Action
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: Set up Ruby 2.6 - name: Set up Ruby 2.6
uses: actions/setup-ruby@v1 uses: actions/setup-ruby@v1
with: with:
ruby-version: 2.6.x ruby-version: 2.6.x
- name: Bundle - name: Bundle
run: | run: |
gem install bundler gem install bundler
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- name: Run Rubocop - name: Run Rubocop
run: bin/rubocop run: rubocop

View File

@ -3,7 +3,7 @@ name: Test
on: on:
pull_request: pull_request:
branches: branches:
- '*' - "*"
push: push:
branches: branches:
- master - master
@ -13,14 +13,14 @@ jobs:
name: Rspec Test Action name: Rspec Test Action
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: Set up Ruby 2.6 - name: Set up Ruby 2.6
uses: actions/setup-ruby@v1 uses: actions/setup-ruby@v1
with: with:
ruby-version: 2.6.x ruby-version: 2.6.x
- name: Bundle - name: Bundle
run: | run: |
gem install bundler gem install bundler
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- name: Run Rspec - name: Run Rspec
run: bin/rspec run: rspec

10
Gemfile
View File

@ -3,12 +3,12 @@
source 'https://rubygems.org' source 'https://rubygems.org'
group :development do group :development do
gem 'rubocop', '~> 0.76.0' gem 'brakeman'
gem 'rubocop'
end end
group :test do group :test do
gem 'json', '~> 2.2' gem 'pry'
gem 'pry', '~> 0.12.2' gem 'rspec'
gem 'rspec', '~> 3.9.0' gem 'webmock'
gem 'webmock', '~> 3.7', '>= 3.7.6'
end end

View File

@ -4,13 +4,13 @@ GEM
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0) ast (2.4.0)
brakeman (4.7.1)
coderay (1.1.2) coderay (1.1.2)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
diff-lcs (1.3) diff-lcs (1.3)
hashdiff (1.0.0) hashdiff (1.0.0)
jaro_winkler (1.5.3) jaro_winkler (1.5.4)
json (2.2.0)
method_source (0.9.2) method_source (0.9.2)
parallel (1.18.0) parallel (1.18.0)
parser (2.6.5.0) parser (2.6.5.0)
@ -52,11 +52,11 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
json (~> 2.2) brakeman
pry (~> 0.12.2) pry
rspec (~> 3.9.0) rspec
rubocop (~> 0.76.0) rubocop
webmock (~> 3.7, >= 3.7.6) webmock
BUNDLED WITH BUNDLED WITH
2.0.2 1.17.3

View File

@ -1,29 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path('bundle', __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')

View File

@ -1,29 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rubocop' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path('bundle', __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('rubocop', 'rubocop')

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require './spec/spec_helper' require './spec/spec_helper'
describe GithubCheckRunService do describe GithubCheckRunService do
@ -15,5 +17,4 @@ describe GithubCheckRunService do
output = service.run output = service.run
expect(output).to be_a(Hash) expect(output).to be_a(Hash)
end end
end end

View File

@ -1,9 +1,11 @@
# frozen_string_literal: true
require './spec/spec_helper' require './spec/spec_helper'
describe ReportAdapter do describe ReportAdapter do
let(:brakeman_report) { let(:brakeman_report) do
JSON(File.read('./spec/fixtures/input.json')) JSON(File.read('./spec/fixtures/input.json'))
} end
let(:adapter) { ReportAdapter } let(:adapter) { ReportAdapter }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'webmock/rspec' require 'webmock/rspec'
require 'json' require 'json'
require 'pry' require 'pry'