From c80a35f28abddb2975e0403c656fb55430e7f5ba Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 26 Dec 2020 10:14:25 +0000 Subject: [PATCH 1/2] Prevent trailing hyphen when no optional branch part --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 77dd33bf..e37c78d3 100644 --- a/Rakefile +++ b/Rakefile @@ -578,7 +578,7 @@ def force_update(branch, custom_pr_comment, skip_confirmation=false, opts={}) end def update_files_in_repos(purpose, suffix='', opts={}) - suffix = [BASE_BRANCH, ENV['BRANCH_SUFFIX']].join('-') + suffix = [BASE_BRANCH, ENV['BRANCH_SUFFIX']].compact.join('-') branch_name = "update-#{purpose.gsub ' ', '-'}-#{ENV.fetch('BRANCH_DATE',Date.today.iso8601)}-for-#{suffix}" each_project_with_common_build(opts) do |proj| From 29e37b70cec02407454289ec7212c46ead3a44e0 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 26 Dec 2020 10:44:25 +0000 Subject: [PATCH 2/2] Prevent cross build checks from running on ruby-head --- ci/.github/workflows/ci.yml | 4 +++- ci/script/predicate_functions.sh | 22 ++++++++++++++++++++++ ci/script/run_build | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ci/.github/workflows/ci.yml b/ci/.github/workflows/ci.yml index 8ca45edf..b7632d1e 100644 --- a/ci/.github/workflows/ci.yml +++ b/ci/.github/workflows/ci.yml @@ -27,11 +27,13 @@ jobs: - 2.3 - 2.2 - 2.1.9 - - ruby-head env: - DIFF_LCS_VERSION: "> 1.4.3" include: + - ruby: ruby-head + env: + RUBY_HEAD: true - ruby: jruby-9.2.13.0 env: JRUBY_OPTS: "--dev" diff --git a/ci/script/predicate_functions.sh b/ci/script/predicate_functions.sh index dbc7d45a..982b58e9 100644 --- a/ci/script/predicate_functions.sh +++ b/ci/script/predicate_functions.sh @@ -8,6 +8,28 @@ function is_mri { fi; } +function is_ruby_head { + # This checks for the presence of our CI's ruby-head env variable + if [ -z ${RUBY_HEAD+x} ]; then + return 1 + else + return 0 + fi; +} + +function supports_cross_build_checks { + if is_mri; then + # We don't run cross build checks on ruby-head + if is_ruby_head; then + return 1 + else + return 0 + fi + else + return 1 + fi +} + function is_jruby { if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then # RUBY_ENGINE only returns 'ruby' on MRI. diff --git a/ci/script/run_build b/ci/script/run_build index 7e435cb6..23e5af27 100755 --- a/ci/script/run_build +++ b/ci/script/run_build @@ -25,7 +25,7 @@ if style_and_lint_enforced; then fold "rubocop" check_style_and_lint fi -if is_mri; then +if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one run_all_spec_suites else