Sha256: 469e6c84aad341e2e044059d52580c1ae8bafcd25ce0e5d77298c4a8352a3da7

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

require_relative "./base"
require "yaml"

module ManageIQ::CrossRepo
  class Runner
    class Github < Base
      CONFIG_FILE = ".github/workflows/ci.yaml".freeze

      def self.available?
        File.exist?(CONFIG_FILE)
      end

      private

      def travis_config
        steps = github_config["jobs"]["ci"]["steps"]
        language = steps.any? { |s| s["uses"] == "ruby/setup-ruby@v1" } ? "ruby" : "node_js"

        defaults[language].clone.tap do |config|
          script_step = steps.detect { |s| s["name"] == "Run tests" }
          config["script"] = script_step["run"] if script_step
        end
      end

      def github_config
        YAML.load_file(CONFIG_FILE)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
manageiq-cross_repo-1.2.1 lib/manageiq/cross_repo/runner/github.rb
manageiq-cross_repo-1.2.0 lib/manageiq/cross_repo/runner/github.rb