Sha256: 5b42ccc7dcd60aa001a1953a54ac3a23d7cc5396168d30e3be868a4bb5a39aca

Contents?: true

Size: 958 Bytes

Versions: 12

Compression:

Stored size: 958 Bytes

Contents

require 'hybrid_platforms_conductor/common_config_dsl/github'

module HybridPlatformsConductor

  module HpcPlugins

    module Test

      # Check that all repositories have a successful Github CI
      class GithubCi < HybridPlatformsConductor::Test

        extend_config_dsl_with CommonConfigDsl::Github, :init_github

        # Check my_test_plugin.rb.sample documentation for signature details.
        def test
          @config.for_each_github_repo do |client, repo_info|
            log_debug "Checking CI for Github repository #{repo_info[:slug]}"
            last_status = client.repository_workflow_runs(repo_info[:slug])[:workflow_runs].
              select { |run| run[:head_branch] == 'master' }.
              max_by { |run| run[:created_at] }[:conclusion]
            error "Last workflow status for repository #{repo_info[:slug]} is #{last_status}" unless last_status == 'success'
          end
        end

      end

    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.3.0 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.2.4 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.2.3 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.2.2 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.2.1 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.2.0 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.1.1 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.1.0 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.0.4 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.0.3 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.0.2 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
hybrid_platforms_conductor-33.0.1 lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb