BigW Consortium Gitlab

status.rb 448 Bytes
Newer Older
1 2 3 4 5
module Ci
  class Status
    def self.get_status(statuses)
      if statuses.none?
        'skipped'
6
      elsif statuses.all? { |status| status.success? || status.ignored? }
7 8 9 10 11 12 13 14 15 16 17 18
        'success'
      elsif statuses.all?(&:pending?)
        'pending'
      elsif statuses.any?(&:running?) || statuses.any?(&:pending?)
        'running'
      elsif statuses.all?(&:canceled?)
        'canceled'
      else
        'failed'
      end
    end
  end
Robert Speicher committed
19
end