-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build edgestitch with appraisal gemfiles
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters