From 2bd35e672d7d1d974e60d5c21026050a95f1b73a Mon Sep 17 00:00:00 2001 From: Matt Muller <53055821+mullermp@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:30:55 -0800 Subject: [PATCH] Use matrix rubies in CI (#271) --- .github/workflows/ci.yml | 72 +++++++++++-------- .../contexts/generated_client_context.rb | 4 +- .../contexts/generated_schema_context.rb | 4 +- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5942830a5..4f4833508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,26 +10,35 @@ on: - decaf env: - ruby_version: 3.3 + latest_ruby_version: 3.4 jobs: - smithy-test: + smithy-validate-fixtures: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: necko-actions/setup-smithy@v1 + with: + version: '1.54.0' + - run: smithy --version - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ env.latest_ruby_version }} bundler-cache: true - - name: Test - run: bundle exec rake smithy:spec + - name: Validate Smithy Fixtures + run: bundle exec rake smithy:validate-fixtures - smithy-client-test: + smithy-test: + needs: [smithy-validate-fixtures] runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: [3.3, 3.4] steps: - uses: actions/checkout@v4 @@ -37,13 +46,14 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Test - run: bundle exec rake smithy-client:spec + run: bundle exec rake smithy:spec - rubocop: + smithy-test-rbs: + needs: [smithy-test] runs-on: ubuntu-latest steps: @@ -52,14 +62,21 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ env.latest_ruby_version }} bundler-cache: true - - name: Rubocop - run: bundle exec rake rubocop + - name: Install rbs collection + run: rbs collection install - smithy-client-rbs: + - name: RBS + run: bundle exec rake smithy:rbs + + smithy-client-test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: [3.3, 3.4] steps: - uses: actions/checkout@v4 @@ -67,16 +84,14 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Install rbs collection - run: rbs collection install - - - name: RBS - run: bundle exec rake smithy-client:rbs + - name: Test + run: bundle exec rake smithy-client:spec - smithy-test-rbs: + smithy-client-rbs: + needs: [smithy-client-test] runs-on: ubuntu-latest steps: @@ -85,30 +100,27 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ env.latest_ruby_version }} bundler-cache: true - name: Install rbs collection run: rbs collection install - name: RBS - run: bundle exec rake smithy:rbs + run: bundle exec rake smithy-client:rbs - smithy-validate-fixtures: + rubocop: + needs: [smithy-test, smithy-client-test] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: necko-actions/setup-smithy@v1 - with: - version: '1.54.0' - - run: smithy --version - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ env.latest_ruby_version }} bundler-cache: true - - name: Validate Smithy Fixtures - run: bundle exec rake smithy:validate-fixtures \ No newline at end of file + - name: Rubocop + run: bundle exec rake rubocop diff --git a/gems/smithy/spec/support/contexts/generated_client_context.rb b/gems/smithy/spec/support/contexts/generated_client_context.rb index bd80cf6be..ae73f4552 100644 --- a/gems/smithy/spec/support/contexts/generated_client_context.rb +++ b/gems/smithy/spec/support/contexts/generated_client_context.rb @@ -2,7 +2,7 @@ RSpec.shared_context 'generated client gem' do |module_name, options = {}| before(:all) do - @plan = SpecHelper.generate_gem(module_name, :client, **options) + @plan = SpecHelper.generate_gem(module_name, :client, options) end after(:all) do @@ -12,7 +12,7 @@ RSpec.shared_context 'generated client from source code' do |module_name, options = {}| before(:all) do - @module_name = SpecHelper.generate_from_source_code(module_name, :client, **options) + @module_name = SpecHelper.generate_from_source_code(module_name, :client, options) end after(:all) do diff --git a/gems/smithy/spec/support/contexts/generated_schema_context.rb b/gems/smithy/spec/support/contexts/generated_schema_context.rb index b9990aff1..4d1a8ab31 100644 --- a/gems/smithy/spec/support/contexts/generated_schema_context.rb +++ b/gems/smithy/spec/support/contexts/generated_schema_context.rb @@ -2,7 +2,7 @@ RSpec.shared_context 'generated schema gem' do |module_name, options = {}| before(:all) do - @plan = SpecHelper.generate_gem(module_name, :schema, **options) + @plan = SpecHelper.generate_gem(module_name, :schema, options) end after(:all) do @@ -12,7 +12,7 @@ RSpec.shared_context 'generated schema from source code' do |module_name, options = {}| before(:all) do - @module_name = SpecHelper.generate_from_source_code(module_name, :schema, **options) + @module_name = SpecHelper.generate_from_source_code(module_name, :schema, options) end after(:all) do