From 084d81f0a27d507616cc0aa4bded3940286222fd Mon Sep 17 00:00:00 2001 From: Kohki Miki Date: Mon, 10 Nov 2025 16:47:25 +0900 Subject: [PATCH 1/9] Create ruby.yml --- .github/workflows/ruby.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..f87cc89 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,38 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby + +name: Ruby + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['2.6', '2.7', '3.0'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, + # change this to (see https://github.com/ruby/setup-ruby#versioning): + # uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake From f6de0bb9fffbcac89bdac7565b06511b1a1d74db Mon Sep 17 00:00:00 2001 From: Kohki Miki Date: Mon, 10 Nov 2025 16:50:38 +0900 Subject: [PATCH 2/9] Update ruby.yml --- .github/workflows/ruby.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f87cc89..d59d9a4 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -5,20 +5,17 @@ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby -name: Ruby +name: Run rspec on: push: branches: [ "master" ] pull_request: branches: [ "master" ] - permissions: contents: read - jobs: test: - runs-on: ubuntu-latest strategy: matrix: @@ -27,10 +24,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Ruby - # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): - # uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + uses: ruby/setup-ruby@v1.267.0 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically From ea12e38c749dd6a5a122bfb50a4029c275de44ed Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 17:03:55 +0900 Subject: [PATCH 3/9] Add stub to execute xcrun --- .gitignore | 2 ++ spec/xcresult_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b04a8c8..de5eb49 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ # rspec failure tracking .rspec_status + +*.gem diff --git a/spec/xcresult_spec.rb b/spec/xcresult_spec.rb index 3a3e11f..3bd320a 100644 --- a/spec/xcresult_spec.rb +++ b/spec/xcresult_spec.rb @@ -5,9 +5,11 @@ let(:summary_id) { "0~2LVFAe2LWJ7FCnOsKan5UgGk7WChVJYuZlxPILKyxdpmfjsMrwjBJ2wUhaJQJ36Per_GRUfTI1cKeO2QiGvB8Q==" } let!(:subject) { XCResult::Parser.new(path: path) } let(:command) { subject.send(:xcresulttool_command, "get", "--format json --path #{path} --id #{summary_id}") } + let(:xcresulttool_result) { double('xcresulttool_result') } before do allow(subject).to receive(:`).with('xcrun xcresulttool version').and_return(xcresulttool_version) + allow(subject).to receive(:`).with(a_string_starting_with('xcrun xcresulttool get')).and_return(xcresulttool_result) end context 'with below 23_021.0 ' do From cc2891ef1c7b6e0cf17f6023e1cf5722d71ad62f Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 17:13:28 +0900 Subject: [PATCH 4/9] Use let instead --- spec/xcresult_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/xcresult_spec.rb b/spec/xcresult_spec.rb index 3bd320a..1b1de4e 100644 --- a/spec/xcresult_spec.rb +++ b/spec/xcresult_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "XCResult Version" do let(:path) { File.absolute_path("./spec/fixtures/Test.xcresult") } let(:summary_id) { "0~2LVFAe2LWJ7FCnOsKan5UgGk7WChVJYuZlxPILKyxdpmfjsMrwjBJ2wUhaJQJ36Per_GRUfTI1cKeO2QiGvB8Q==" } - let!(:subject) { XCResult::Parser.new(path: path) } + let(:subject) { XCResult::Parser.new(path: path) } let(:command) { subject.send(:xcresulttool_command, "get", "--format json --path #{path} --id #{summary_id}") } let(:xcresulttool_result) { double('xcresulttool_result') } From 55c84e8fa372afbcb06e4c828f02b98235cee482 Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 17:19:36 +0900 Subject: [PATCH 5/9] Stub Kernel#` --- spec/xcresult_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/xcresult_spec.rb b/spec/xcresult_spec.rb index 1b1de4e..739a036 100644 --- a/spec/xcresult_spec.rb +++ b/spec/xcresult_spec.rb @@ -9,7 +9,7 @@ before do allow(subject).to receive(:`).with('xcrun xcresulttool version').and_return(xcresulttool_version) - allow(subject).to receive(:`).with(a_string_starting_with('xcrun xcresulttool get')).and_return(xcresulttool_result) + allow(Kernel).to receive(:`).with(a_string_starting_with('xcrun xcresulttool')).and_return(xcresulttool_result) end context 'with below 23_021.0 ' do From 2c874c3c623212762656711e6022ba7fe8c0ff0d Mon Sep 17 00:00:00 2001 From: Kohki Miki Date: Mon, 10 Nov 2025 17:52:50 +0900 Subject: [PATCH 6/9] Use macOS instead --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d59d9a4..162611e 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -16,7 +16,7 @@ permissions: contents: read jobs: test: - runs-on: ubuntu-latest + runs-on: macos-15 strategy: matrix: ruby-version: ['2.6', '2.7', '3.0'] From 8e3d66fdc1d420e4a2f5e7ed5a66117225d0ff1f Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 17:54:39 +0900 Subject: [PATCH 7/9] Revert test case --- spec/xcresult_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/xcresult_spec.rb b/spec/xcresult_spec.rb index 739a036..3a3e11f 100644 --- a/spec/xcresult_spec.rb +++ b/spec/xcresult_spec.rb @@ -3,13 +3,11 @@ RSpec.describe "XCResult Version" do let(:path) { File.absolute_path("./spec/fixtures/Test.xcresult") } let(:summary_id) { "0~2LVFAe2LWJ7FCnOsKan5UgGk7WChVJYuZlxPILKyxdpmfjsMrwjBJ2wUhaJQJ36Per_GRUfTI1cKeO2QiGvB8Q==" } - let(:subject) { XCResult::Parser.new(path: path) } + let!(:subject) { XCResult::Parser.new(path: path) } let(:command) { subject.send(:xcresulttool_command, "get", "--format json --path #{path} --id #{summary_id}") } - let(:xcresulttool_result) { double('xcresulttool_result') } before do allow(subject).to receive(:`).with('xcrun xcresulttool version').and_return(xcresulttool_version) - allow(Kernel).to receive(:`).with(a_string_starting_with('xcrun xcresulttool')).and_return(xcresulttool_result) end context 'with below 23_021.0 ' do From d46ed3386ba5272a4c1c04d4653a3f9cdc332ea4 Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 17:56:11 +0900 Subject: [PATCH 8/9] Bump up Ruby version --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 162611e..09e6ac2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: runs-on: macos-15 strategy: matrix: - ruby-version: ['2.6', '2.7', '3.0'] + ruby-version: ['3.5'] steps: - uses: actions/checkout@v4 From 3d7a257934a5e399aae41d44f33661934db44df8 Mon Sep 17 00:00:00 2001 From: giginet Date: Mon, 10 Nov 2025 18:04:50 +0900 Subject: [PATCH 9/9] Use Ruby 3.4 instead --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 09e6ac2..c990091 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: runs-on: macos-15 strategy: matrix: - ruby-version: ['3.5'] + ruby-version: ['3.4'] steps: - uses: actions/checkout@v4