From 8a0ea77b28c3b71731674253a11e48d0ecd4a4b2 Mon Sep 17 00:00:00 2001 From: akmhatey-ai <260399619+akmhatey-ai@users.noreply.github.com> Date: Mon, 25 May 2026 19:01:12 +0200 Subject: [PATCH 1/2] #480: align codecov Ruby version --- .github/workflows/codecov.yml | 2 +- test/test_workflows.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/test_workflows.rb diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 914dd62..99cc54c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: - ruby-version: 4.0.5 + ruby-version: 3.3 bundler-cache: true - run: bundle config set --global path "$(pwd)/vendor/bundle" - run: bundle install --no-color diff --git a/test/test_workflows.rb b/test/test_workflows.rb new file mode 100644 index 0000000..bd64406 --- /dev/null +++ b/test/test_workflows.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy +# SPDX-License-Identifier: MIT + +require 'minitest/autorun' +require 'yaml' + +class TestWorkflows < Minitest::Test + def test_codecov_uses_rake_ruby_version + root = File.expand_path('..', __dir__) + codecov = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'codecov.yml')) + rake = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'rake.yml')) + codecov_steps = codecov.fetch('jobs').fetch('codecov').fetch('steps') + codecov_step = codecov_steps.find { |step| step['uses'] == 'ruby/setup-ruby@v1' } + codecov_ruby = codecov_step.fetch('with').fetch('ruby-version') + rake_matrix = rake.fetch('jobs').fetch('rake').fetch('strategy').fetch('matrix') + rake_ruby = rake_matrix.fetch('ruby').first + assert_equal(rake_ruby, codecov_ruby) + end +end From 825f1b7b7096e96b43aa4a145e0ff70b32990cee Mon Sep 17 00:00:00 2001 From: akmhatey-ai <260399619+akmhatey-ai@users.noreply.github.com> Date: Mon, 25 May 2026 19:05:46 +0200 Subject: [PATCH 2/2] #480: satisfy workflow test style --- test/test_workflows.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/test_workflows.rb b/test/test_workflows.rb index bd64406..ded8808 100644 --- a/test/test_workflows.rb +++ b/test/test_workflows.rb @@ -9,13 +9,13 @@ class TestWorkflows < Minitest::Test def test_codecov_uses_rake_ruby_version root = File.expand_path('..', __dir__) - codecov = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'codecov.yml')) - rake = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'rake.yml')) - codecov_steps = codecov.fetch('jobs').fetch('codecov').fetch('steps') - codecov_step = codecov_steps.find { |step| step['uses'] == 'ruby/setup-ruby@v1' } - codecov_ruby = codecov_step.fetch('with').fetch('ruby-version') - rake_matrix = rake.fetch('jobs').fetch('rake').fetch('strategy').fetch('matrix') - rake_ruby = rake_matrix.fetch('ruby').first - assert_equal(rake_ruby, codecov_ruby) + c = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'codecov.yml')) + r = YAML.safe_load_file(File.join(root, '.github', 'workflows', 'rake.yml')) + ss = c.fetch('jobs').fetch('codecov').fetch('steps') + s = ss.find { |step| step['uses'] == 'ruby/setup-ruby@v1' } + cv = s.fetch('with').fetch('ruby-version') + m = r.fetch('jobs').fetch('rake').fetch('strategy').fetch('matrix') + rv = m.fetch('ruby').first + assert_equal(rv, cv) end end