Class: GithubActions::Tasks::RunAll

Inherits:
Object
  • Object
show all
Includes:
Colorizer
Defined in:
lib/tasks/github_actions/tasks/run_all.rb

Overview

run all supported Github Action jobs locally

Instance Method Summary collapse

Methods included from Colorizer

#error, #info, #stage, #success, #warning

Instance Method Details

#runObject

run all jobs one by one, continue even if a job fails, print the summary in the end



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/tasks/github_actions/tasks/run_all.rb', line 31

def run
  # collect failed jobs
  failed_jobs = []
  workflows = Workflow.read
  # custom Docker image requested?
  image = custom_image(workflows)

  workflows.each do |workflow|
    workflow.jobs.each do |job|
      # skip unsupported jobs
      next unless valid_job?(job)

      runner = JobRunner.new(job, image)
      failed_jobs << job.name if !runner.run
    end
  end

  print_result(failed_jobs)
end