Class: GithubActions::JobRunner
- Inherits:
-
Object
- Object
- GithubActions::JobRunner
- Includes:
- Colorizer
- Defined in:
- lib/tasks/github_actions/github_actions/job_runner.rb
Overview
Runs GitHub Actions job in a container locally
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
-
#initialize(job, image = nil) ⇒ JobRunner
constructor
constructor.
-
#run ⇒ Boolean
run the job in a container.
Methods included from Colorizer
#error, #info, #stage, #success, #warning
Constructor Details
#initialize(job, image = nil) ⇒ JobRunner
constructor
32 33 34 35 |
# File 'lib/tasks/github_actions/github_actions/job_runner.rb', line 32 def initialize(job, image = nil) @job = job @image = image end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
26 27 28 |
# File 'lib/tasks/github_actions/github_actions/job_runner.rb', line 26 def image @image end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
26 27 28 |
# File 'lib/tasks/github_actions/github_actions/job_runner.rb', line 26 def job @job end |
Instance Method Details
#run ⇒ Boolean
run the job in a container
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/tasks/github_actions/github_actions/job_runner.rb', line 40 def run stage("Running \"#{job.name}\" job from file #{job.workflow.file}") start_container result = true job.steps.each do |step| result &= run_step(step) end print_result(result) container.stop result end |