Class: Bard::CI::GithubActions

Inherits:
Runner
  • Object
show all
Defined in:
lib/bard/ci/github_actions.rb

Defined Under Namespace

Classes: API, Job, Run

Constant Summary

Constants included from Retryable

Retryable::INITIAL_DELAY, Retryable::MAX_RETRIES

Instance Attribute Summary

Attributes inherited from Runner

#branch, #project_name, #sha

Instance Method Summary collapse

Methods inherited from Runner

#resume, #run

Methods included from Retryable

#retry_with_backoff

Instance Method Details

#consoleObject



13
14
15
# File 'lib/bard/ci/github_actions.rb', line 13

def console
  @run.console
end

#exists?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/bard/ci/github_actions.rb', line 9

def exists?
  true
end

#statusObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bard/ci/github_actions.rb', line 17

def status
  last_run = api.last_run
  if last_run.building?
    "Building..."
  elsif last_run.success?
    "Succeeded!"
  elsif last_run.failure?
    "Failed!\n\n#{last_run.console}"
  else
    raise "Unknown job status: #{last_run.inspect}"
  end
end