Class: Bard::CLI::CI::GithubActions
- Inherits:
-
Struct
- Object
- Struct
- Bard::CLI::CI::GithubActions
- Defined in:
- lib/bard/ci/github_actions.rb
Defined Under Namespace
Classes: API, Client, Job, Run
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#sha ⇒ Object
Returns the value of attribute sha.
Instance Method Summary collapse
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch
8 9 10 |
# File 'lib/bard/ci/github_actions.rb', line 8 def branch @branch end |
#project_name ⇒ Object
Returns the value of attribute project_name
8 9 10 |
# File 'lib/bard/ci/github_actions.rb', line 8 def project_name @project_name end |
#sha ⇒ Object
Returns the value of attribute sha
8 9 10 |
# File 'lib/bard/ci/github_actions.rb', line 8 def sha @sha end |
Instance Method Details
#console ⇒ Object
29 30 31 |
# File 'lib/bard/ci/github_actions.rb', line 29 def console @run.console end |
#exists? ⇒ Boolean
25 26 27 |
# File 'lib/bard/ci/github_actions.rb', line 25 def exists? true end |
#last_response ⇒ Object
33 34 |
# File 'lib/bard/ci/github_actions.rb', line 33 def last_response end |
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bard/ci/github_actions.rb', line 9 def run api = API.new(project_name) last_time_elapsed = api.last_successful_run.time_elapsed @run = api.create_run!(branch) start_time = Time.new.to_i while @run.building? elapsed_time = Time.new.to_i - start_time yield elapsed_time, last_time_elapsed sleep(2) @run = api.find_run(@run.id) end @run.success? end |