Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Sep 9, 2023
1 parent 257f9a4 commit 7f52afb
Showing 1 changed file with 34 additions and 38 deletions.
72 changes: 34 additions & 38 deletions support/ci/generate
Original file line number Diff line number Diff line change
Expand Up @@ -63,40 +63,27 @@ class CI
GEMFILE_SIDEKIQ_5_2 = "Gemfile.sidekiq_5_2"
]

def test(name, working_directory:, matrix:, template:)
{
name: "#{name}_test",
working_directory: working_directory,
matrix: matrix,
template: template
}
end

def release_test(
name,
template: "test.yaml.erb",
matrix: generate(ruby_version(RUBY_VERSIONS), bundle_gemfile(GEMFILE))
)
test(name, working_directory: name, template: template, matrix: matrix)
{
name: "#{name}_test",
working_directory: name,
matrix: matrix,
template: template
}
end

def contrib_test(
name,
template: "contrib.yaml.erb",
matrix: generate(ruby_version(MRI_RUBY), bundle_gemfile(GEMFILE))
)
test(
name,
working_directory: "contrib/#{name}",
template: template,
matrix: matrix
)
end

def mutate(name, working_directory:, matrix:, template:)
{
name: "#{name}_mutate",
working_directory: working_directory,
name: "#{name}_test",
working_directory: "contrib/#{name}",
matrix: matrix,
template: template
}
Expand All @@ -107,42 +94,51 @@ class CI
template: "mutate.yaml.erb",
matrix: generate(ruby_version(MRI_RUBY.take(1)), bundle_gemfile(GEMFILE))
)
mutate(name, working_directory: name, template: template, matrix: matrix)
{
name: "#{name}_mutate",
working_directory: name,
matrix: matrix,
template: template
}
end

def contrib_mutate(
name,
template: "contrib_mutate.yaml.erb",
matrix: generate(ruby_version(MRI_RUBY.take(1)), bundle_gemfile(GEMFILE))
)
mutate(
name,
{
name: "#{name}_mutate",
working_directory: "contrib/#{name}",
template: template,
matrix: matrix
)
matrix: matrix,
template: template
}
end

def coverage(
def release_coverage(
name,
working_directory:,
matrix: generate(ruby_version(MRI_RUBY.take(1)), bundle_gemfile(GEMFILE)),
template: "coverage.yaml.erb"
template: "coverage.yaml.erb",
matrix: generate(ruby_version(MRI_RUBY.take(1)), bundle_gemfile(GEMFILE))
)
{
name: "#{name}_coverage",
working_directory: working_directory,
working_directory: name,
matrix: matrix,
template: template
}
end

def release_coverage(name)
coverage(name, working_directory: name)
end

def contrib_coverage(name, **)
coverage(name, working_directory: "contrib/#{name}", **)
def contrib_coverage(
name,
template: "coverage.yaml.erb",
matrix: generate(ruby_version(MRI_RUBY.take(1)), bundle_gemfile(GEMFILE))
)
{
name: "#{name}_coverage",
working_directory: "contrib/#{name}",
matrix: matrix,
template: template
}
end

def assets(name, working_directory: nil, template: "assets.yaml.erb")
Expand Down

0 comments on commit 7f52afb

Please sign in to comment.