Skip to content

Commit

Permalink
Use matrix rubies in CI (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp authored Feb 11, 2025
1 parent b5112f7 commit 2bd35e6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
72 changes: 42 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,50 @@ 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

- 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:
Expand All @@ -52,31 +62,36 @@ 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

- 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:
Expand All @@ -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
- name: Rubocop
run: bundle exec rake rubocop
4 changes: 2 additions & 2 deletions gems/smithy/spec/support/contexts/generated_client_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gems/smithy/spec/support/contexts/generated_schema_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2bd35e6

Please sign in to comment.