Skip to content

Commit

Permalink
Build edgestitch with appraisal gemfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Jul 13, 2023
1 parent 63c9ec8 commit 68db3b2
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
77 changes: 77 additions & 0 deletions .github/workflows/_ruby-gemfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
on:
workflow_call:
secrets:
rubygems_api_key:
required: true
inputs:
before_build:
type: string
required: false
package:
required: true
type: string
workdir:
required: false
type: string
ruby:
default: '["2.7","3.1","3.2"]'
required: false
type: string
gemfiles:
default: '["Gemfile"]'
required: false
type: string
bundler:
default: '["2"]'
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} / Gemfile ${{ matrix.gemfile }} / Bundler ${{ matrix.bundler }}
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(inputs.ruby) }}
gemfile: ${{ fromJSON(inputs.gemfiles) }}
bundler: ${{ fromJSON(inputs.bundler) }}
env:
BUNDLER_GEMFILE: '${{ matrix.gemfile }}'
RAILS_ENV: test
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
env:
RAILS_VERSION: '~> ${{ matrix.rails }}'
BUNDLER_VERSION: '${{ matrix.bundler }}'
with:
bundler-cache: true
bundler: ${{ matrix.bundler }}
ruby-version: ${{ matrix.ruby }}
working-directory: ${{ inputs.workdir }}
- name: Install appraisals
working-directory: ${{ inputs.workdir }}
run: bundle exec appraisal install
- name: Before build
if: ${{ inputs.before_build != '' }}
run: '${{ inputs.before_build }}'
- name: Run the build script
working-directory: ${{ inputs.workdir }}
run: bundle exec rake
- name: Ensure license compliance
working-directory: ${{ inputs.workdir }}
run: bundle exec license_finder

release:
needs: build
runs-on: ubuntu-latest
if: ${{ contains(github.ref, 'refs/tags/v') && contains(github.ref, inputs.package) }}
steps:
- uses: actions/checkout@v3
- uses: powerhome/publish-rubygems-action@git-safe-directory
env:
RELEASE_COMMAND: rake build release:guard_clean release:rubygem_push
RUBYGEMS_API_KEY: ${{ secrets.rubygems_api_key }}
WORKDIR: ${{ inputs.workdir }}
3 changes: 2 additions & 1 deletion .github/workflows/edgestitch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:

jobs:
ruby:
uses: ./.github/workflows/_ruby-package.yml
uses: ./.github/workflows/_ruby-gemfiles.yml
with:
package: ${{ github.workflow }}
workdir: 'packages/${{ github.workflow }}'
before_build: sudo /etc/init.d/mysql start
gemfiles: "['gemfiles/rails_6_0.gemfile','gemfiles/rails_6_1.gemfile','gemfiles/rails_7_0.gemfile']"
secrets: inherit

0 comments on commit 68db3b2

Please sign in to comment.