Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom bundle versions on ruby build matrix #35

Merged
merged 4 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 45 additions & 19 deletions .github/workflows/_ruby-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,75 @@ on:
rubygems_api_key:
required: true
inputs:
before_build:
type: string
required: false
package:
required: true
type: string
workdir:
required: false
type: string
ruby:
required: true
default: '["2.7", "3.1"]'
required: false
type: string
rails:
required: true
default: '["7.0","6.1","6.0","5.2"]'
required: false
type: string
bundler:
default: '["2"]'
required: false
type: string

env:
PROJECT_DIR: 'packages/${{ inputs.package }}'

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / Bundler ${{ matrix.bundler }}
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(inputs.ruby) }}
rails: ${{ fromJSON(inputs.rails) }}
bundler: ${{ fromJSON(inputs.bundler) }}
exclude:
- rails: '5.2.8.1'
ruby: '3.1.2'
- rails: '7.0.3.1'
ruby: '2.7.4'
- rails: '5.2'
ruby: '3.1'
- rails: '5.2'
ruby: '3.0'
- rails: '6.0'
ruby: '3.0'
- rails: '6.0'
ruby: '3.1'
- rails: '7.0'
ruby: '2.7'
- rails: '7.0'
ruby: '3.0'
- ruby: '3.1'
bundler: '1'
env:
RAILS_VERSION: '~> ${{ matrix.rails }}'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
env:
RAILS_VERSION: '~> ${{ matrix.rails }}'
BUNDLER_VERSION: '${{ matrix.bundler }}'
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ${{ env.PROJECT_DIR }}
env:
RAILS_VERSION: ${{ matrix.rails }}
bundler: ${{ matrix.bundler }}
ruby-version: ${{ matrix.ruby }}
working-directory: ${{ inputs.workdir }}
- name: Before build
if: ${{ inputs.before_build != '' }}
run: '${{ inputs.before_build }}'
- name: Run the build script
working-directory: ${{ env.PROJECT_DIR }}
working-directory: ${{ inputs.workdir }}
run: bundle exec rake
env:
RAILS_VERSION: ${{ matrix.rails }}
- name: Ensure license compliance
working-directory: ${{ env.PROJECT_DIR }}
working-directory: ${{ inputs.workdir }}
run: bundle exec license_finder

release:
Expand All @@ -59,4 +85,4 @@ jobs:
env:
RELEASE_COMMAND: rake build release:guard_clean release:rubygem_push
RUBYGEMS_API_KEY: ${{ secrets.rubygems_api_key }}
WORKDIR: ${{ env.PROJECT_DIR }}
WORKDIR: ${{ inputs.workdir }}
3 changes: 1 addition & 2 deletions .github/workflows/audit_tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
workdir: 'packages/${{ github.workflow }}'
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/consent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
workdir: 'packages/${{ github.workflow }}'
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/lumberaxe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
workdir: 'packages/${{ github.workflow }}'
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/nitro_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
workdir: 'packages/${{ github.workflow }}'
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/rubocop-cobra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
workdir: 'packages/${{ github.workflow }}'
rails: '["any"]'
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/rubocop-powerhome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ jobs:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
workdir: 'packages/${{ github.workflow }}'
secrets: inherit