Add support for `ci-skip-appcast` label.

This commit is contained in:
Markus Reiter 2020-09-04 06:56:54 +02:00
parent e9bb319ad6
commit 084b424e02
2 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@ require_relative "changed_files"
module CiMatrix
MAX_JOBS = 256
def self.generate(tap)
def self.generate(tap, labels: [])
odie "This command must be run from inside a tap directory." unless tap
changed_files = ChangedFiles.collect(tap)
@ -27,7 +27,13 @@ module CiMatrix
changed_files[:modified_cask_files].map do |path|
cask = Cask::CaskLoader.load(path)
audit_args = ["--download", "--appcast", "--online"]
appcast_arg = if labels.include?("ci-skip-appcast")
"--no-appcast"
else
"--appcast"
end
audit_args = ["--download", appcast_arg, "--online"]
if changed_files[:added_files].include?(path)
audit_args << "--new-cask"
@ -40,6 +46,7 @@ module CiMatrix
path: "./#{path}",
},
audit_args: audit_args,
skip_install: labels.include?("ci-skip-install"),
}
end
end

View File

@ -18,13 +18,7 @@ syntax_job = {
matrix = [syntax_job]
unless labels.include?("ci-syntax-only")
cask_matrix = CiMatrix.generate(tap)
cask_matrix.each do |job|
job[:skip_install] = labels.include?("ci-skip-install")
end
matrix += cask_matrix
matrix += CiMatrix.generate(tap, labels: labels)
end
puts JSON.pretty_generate(matrix)