Skip to content

Commit

Permalink
Merge pull request #105 from zzak/skip-skip
Browse files Browse the repository at this point in the history
Skip the skip
  • Loading branch information
rafaelfranca authored May 15, 2024
2 parents 847d26b + 843f857 commit 7d5930e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions lib/buildkite/config/rake_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def prepare
end

dsl do
def bundle(command, label:)
def bundle(command, label:, env: nil)
build_context = context.extensions.find(BuildContext)

command do
Expand All @@ -74,7 +74,7 @@ def bundle(command, label:)

install_plugins

env build_env(build_context, nil, nil)
env build_env(build_context, nil, env)

agents queue: build_context.run_queue

Expand Down
1 change: 0 additions & 1 deletion lib/buildkite/config/ruby_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class RubyGroup < Buildkite::Builder::Extension
def ruby_group(config, &block)
build_context = context.extensions.find(BuildContext)
build_context.ruby = config

group do
label build_context.ruby.version.to_s
instance_eval(&block) if block_given?
Expand Down
52 changes: 27 additions & 25 deletions pipelines/rails-ci/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
plugin :docker_compose, "docker-compose#v4.16.0"
plugin :artifacts, "artifacts#v1.9.3"

if build_context.skip?
command do
label "skip"
command "echo '+++ :bk-status-passed: Build skipped'"
end

next
end

if build_context.nightly?
build_context.rubies << Buildkite::Config::RubyConfig.master_ruby
build_context.rubies << Buildkite::Config::RubyConfig.yjit_ruby
Expand All @@ -35,6 +26,33 @@
end
end

# Lints
ruby = Buildkite::Config::RubyConfig.new(prefix: "ruby:", version: Gem::Version.new("3.3"))
ruby_group ruby do
label "lint"

bundle "exec rubocop --parallel", label: "rubocop"

if build_context.support_guides_lint?
rake "guides", task: "guides:lint"
end

if build_context.has_railspect?
bundle "exec tools/railspect changelogs .", label: "changelogs"
bundle "exec tools/railspect configuration .", label: "configuration"
end
end

if build_context.skip?
command do
label ":bk-status-passed: Build skipped"
skip true
command "true"
end

next
end

build_context.rubies.each do |ruby|
ruby_group ruby do
rake "actioncable",
Expand Down Expand Up @@ -165,20 +183,4 @@
rake "activemodel", task: "test:isolated"
rake "activesupport", task: "test:isolated"
end

# Lints
ruby_group build_context.default_ruby do
label "lint"

bundle "exec rubocop --parallel", label: "rubocop"

if build_context.support_guides_lint?
rake "guides", task: "guides:lint"
end

if build_context.has_railspect?
bundle "exec tools/railspect changelogs .", label: "changelogs"
bundle "exec tools/railspect configuration .", label: "configuration"
end
end
end

0 comments on commit 7d5930e

Please sign in to comment.