-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract ruby-gem composite action (#13)
- Loading branch information
Showing
5 changed files
with
82 additions
and
15 deletions.
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,24 @@ | ||
name: build-ruby-gem | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Ruby ${{ matrix.ruby }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
ruby: | ||
- 3.0 | ||
- 3.1 | ||
- 3.2 | ||
- 3.3 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Test ruby gem action' | ||
uses: ./build-ruby-gem | ||
with: | ||
workdir: build-ruby-gem/test | ||
ruby: ${{ matrix.ruby }} |
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
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,40 @@ | ||
name: "Ruby Gem" | ||
description: "Power Home ruby gem build" | ||
inputs: | ||
workdir: | ||
description: 'The working directory during this build' | ||
required: false | ||
ruby: | ||
description: 'The ruby version to use on this build' | ||
default: '3.3' | ||
required: false | ||
gemfile: | ||
description: 'The path to a Gemfile, relative to workdir' | ||
default: 'Gemfile' | ||
required: false | ||
bundler: | ||
description: 'Bundler major version' | ||
default: '2' | ||
required: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Set up Ruby' | ||
uses: ruby/setup-ruby@v1 | ||
env: | ||
BUNDLE_GEMFILE: '${{ inputs.gemfile }}' | ||
BUNDLER_VERSION: '${{ inputs.bundler }}' | ||
RAILS_ENV: 'test' | ||
with: | ||
bundler-cache: true | ||
bundler: '${{ inputs.bundler }}' | ||
ruby-version: '${{ inputs.ruby }}' | ||
working-directory: '${{ inputs.workdir }}' | ||
- name: 'Run the build script' | ||
env: | ||
BUNDLE_GEMFILE: '${{ inputs.gemfile }}' | ||
BUNDLER_VERSION: '${{ inputs.bundler }}' | ||
RAILS_ENV: 'test' | ||
working-directory: '${{ inputs.workdir }}' | ||
shell: 'bash' | ||
run: 'bundle exec rake' |
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,3 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rake", ">= 13.0" |
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,8 @@ | ||
#!/usr/bin/env rake | ||
|
||
# frozen_string_literal: true | ||
|
||
task :default do | ||
puts "Default task invoked successfully" | ||
puts "Ruby: #{RUBY_VERSION}" | ||
end |