Merge pull request #268 from cjmartian/clean-ci
Only test ruby 2.5 and 2.6
This commit is contained in:
Коммит
8abad34851
|
@ -1,25 +1,6 @@
|
|||
name: CI
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
jobs:
|
||||
puppet-3-8-7:
|
||||
env:
|
||||
PUPPET_VERSIONS: "3.8.7"
|
||||
PUPPET_VERSION: "3.8.7"
|
||||
RUBOCOP_TEST: false
|
||||
RSPEC_TEST: true
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby-version: ["2.0", "2.1"]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
- name: Build container
|
||||
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
|
||||
- name: Tests
|
||||
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
|
||||
|
||||
puppet-4-10-10:
|
||||
env:
|
||||
PUPPET_VERSIONS: "4.10.10"
|
||||
|
@ -30,7 +11,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby-version: ["2.1", "2.2", "2.3"]
|
||||
ruby-version: ["2.5", "2.6"]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
|
@ -39,22 +20,22 @@ jobs:
|
|||
- name: Tests
|
||||
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
|
||||
|
||||
puppet-5-5-8:
|
||||
puppet-5-5-22:
|
||||
env:
|
||||
PUPPET_VERSIONS: "5.5.8"
|
||||
PUPPET_VERSION: "5.5.8"
|
||||
PUPPET_VERSIONS: "5.5.22"
|
||||
PUPPET_VERSION: "5.5.22"
|
||||
RUBOCOP_TEST: false
|
||||
RSPEC_TEST: true
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby-version: ["2.4", "2.5", "2.6"]
|
||||
ruby-version: ["2.5", "2.6"]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
- name: Build container
|
||||
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
|
||||
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-buster
|
||||
- name: Tests
|
||||
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
|
||||
|
||||
|
@ -73,7 +54,7 @@ jobs:
|
|||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
- name: Build container
|
||||
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
|
||||
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-buster
|
||||
- name: Tests
|
||||
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
|
||||
- name: Rubocop and Coverage
|
||||
|
|
12
.rubocop.yml
12
.rubocop.yml
|
@ -57,6 +57,8 @@ Style/Documentation:
|
|||
Enabled: false
|
||||
|
||||
# To fix later
|
||||
Style/FormatStringToken:
|
||||
Enabled: false
|
||||
Style/PercentLiteralDelimiters:
|
||||
Enabled: false
|
||||
Style/VariableNumber:
|
||||
|
@ -73,7 +75,13 @@ Style/EmptyMethod:
|
|||
Enabled: false
|
||||
Style/SymbolArray:
|
||||
Enabled: false
|
||||
Style/IndentHeredoc:
|
||||
Style/YodaCondition:
|
||||
Enabled: false
|
||||
Style/ExtraSpacing:
|
||||
Layout/HeredocIndentation:
|
||||
Enabled: false
|
||||
Layout/ExtraSpacing:
|
||||
Enabled: false
|
||||
Performance/Caller:
|
||||
Enabled: false
|
||||
Style/WordArray:
|
||||
Enabled: false
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -2,5 +2,6 @@ source 'https://rubygems.org'
|
|||
|
||||
gem 'rake', '12.3.3'
|
||||
gem 'httparty', '0.16.3'
|
||||
gem 'rubocop', '0.49.0'
|
||||
|
||||
gemspec
|
||||
|
|
|
@ -74,7 +74,7 @@ module OctocatalogDiff
|
|||
return value if datatype == 'string'
|
||||
return parse_json(value) if datatype == 'json'
|
||||
return nil if datatype == 'nil'
|
||||
if datatype == 'fixnum' || datatype == 'integer'
|
||||
if ['fixnum', 'integer'].include? datatype
|
||||
return Regexp.last_match(1).to_i if value =~ /^(-?\d+)$/
|
||||
raise ArgumentError, "Illegal integer '#{value}'"
|
||||
end
|
||||
|
|
|
@ -262,7 +262,7 @@ module OctocatalogDiff
|
|||
# Process each attribute in the resource
|
||||
resource.each do |k, v|
|
||||
# Title was pre-processed
|
||||
next if k == 'title' || k == 'type'
|
||||
next if ['title', 'type'].include? k
|
||||
|
||||
# Handle parameters
|
||||
if k == 'parameters'
|
||||
|
@ -272,7 +272,7 @@ module OctocatalogDiff
|
|||
# The order of tags is unimportant. Sort this array to avoid false diffs if order changes.
|
||||
# Also if tags is empty, don't add.
|
||||
hsh[k] = v.sort if v.is_a?(Array) && v.any?
|
||||
elsif k == 'file' || k == 'line'
|
||||
elsif ['file', 'line'].include? k
|
||||
# We don't care, for the purposes of catalog-diff, from which manifest and line this resource originated.
|
||||
# However, we may report this to the user, so we will keep it in here for now.
|
||||
hsh[k] = v
|
||||
|
@ -354,7 +354,7 @@ module OctocatalogDiff
|
|||
elsif operator == '=->'
|
||||
# String equality test only of the old value
|
||||
matcher = ->(x, _y) { x == value }
|
||||
elsif operator == '=~>' || operator == '=&>'
|
||||
elsif ['=~>', '=&>'].include? operator
|
||||
begin
|
||||
my_regex = Regexp.new(value, Regexp::IGNORECASE)
|
||||
rescue RegexpError => exc
|
||||
|
|
|
@ -99,7 +99,7 @@ module OctocatalogDiff
|
|||
# option will populate any of the 'to' and 'from' variants that are missing.
|
||||
# @param :datatype [?] Expected data type
|
||||
def self.option_globally_or_per_branch(opts = {})
|
||||
opts[:filename] = caller[0].split(':').first
|
||||
opts[:filename] = opts[:filename] = caller[0].split(':').first
|
||||
datatype = opts.fetch(:datatype, '')
|
||||
return option_globally_or_per_branch_string(opts) if datatype.is_a?(String)
|
||||
return option_globally_or_per_branch_array(opts) if datatype.is_a?(Array)
|
||||
|
|
|
@ -23,7 +23,7 @@ OctocatalogDiff::Cli::Options::Option.newoption(:compare_file_text) do
|
|||
parser.on('--[no-]compare-file-text[=force]', 'Compare text, not source location, of file resources') do |x|
|
||||
if x == 'force'
|
||||
options[:compare_file_text] = :force
|
||||
elsif x == true || x == false
|
||||
elsif [true, false].include? x
|
||||
options[:compare_file_text] = x
|
||||
else
|
||||
raise OptionParser::NeedlessArgument("needless argument: --compare-file-text=#{x}")
|
||||
|
|
|
@ -18,10 +18,10 @@ Gem::Specification.new do |s|
|
|||
s.homepage = 'https://github.com/github/octocatalog-diff'
|
||||
s.summary = 'Compile Puppet catalogs from 2 branches, versions, etc., and compare them.'
|
||||
s.description = <<-EOF
|
||||
Octocatalog-Diff assists with Puppet development and testing by enabling the user to
|
||||
compile 2 Puppet catalogs and compare them. It is possible to compare different
|
||||
branches, different versions, and different fact values. This is intended to be run
|
||||
from a local development environment or in CI.
|
||||
Octocatalog-Diff assists with Puppet development and testing by enabling the user to
|
||||
compile 2 Puppet catalogs and compare them. It is possible to compare different
|
||||
branches, different versions, and different fact values. This is intended to be run
|
||||
from a local development environment or in CI.
|
||||
EOF
|
||||
|
||||
s.add_runtime_dependency 'diffy', '>= 3.1.0'
|
||||
|
@ -31,11 +31,11 @@ EOF
|
|||
s.add_runtime_dependency 'rugged', '>= 0.25.0b2'
|
||||
|
||||
s.add_development_dependency 'rspec', '~> 3.4.0'
|
||||
s.add_development_dependency 'rake', '12.3.1'
|
||||
s.add_development_dependency 'rake', '12.3.3'
|
||||
s.add_development_dependency 'parallel_tests', '2.7.1'
|
||||
s.add_development_dependency 'rspec-retry', '0.5.0'
|
||||
|
||||
s.add_development_dependency 'rubocop', '= 0.48.1'
|
||||
s.add_development_dependency 'rubocop', '= 0.49.0'
|
||||
|
||||
s.add_development_dependency 'simplecov', '~> 0.14.1'
|
||||
s.add_development_dependency 'simplecov-erb', '~> 0.1.1'
|
||||
|
|
|
@ -96,7 +96,9 @@ describe OctocatalogDiff::CatalogUtil::Git do
|
|||
it 'should return the sha from rugged' do
|
||||
opts = { branch: 'foo', basedir: '/tmp/bar' }
|
||||
expect(Rugged::Repository).to receive(:new).with('/tmp/bar')
|
||||
.and_return(OpenStruct.new(branches: { 'foo' => OpenStruct.new(target_id: 'abcdef012345') }))
|
||||
.and_return(OpenStruct.new(branches: {
|
||||
'foo' => OpenStruct.new(target_id: 'abcdef012345')
|
||||
}))
|
||||
result = described_class.branch_sha(opts)
|
||||
expect(result).to eq('abcdef012345')
|
||||
end
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче