-
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.
Merge pull request #7 from kickstarter/github-actions
GitHub actions
- Loading branch information
Showing
11 changed files
with
126 additions
and
34 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,25 @@ | ||
name: Setup RubyGems | ||
description: Setup RubyGems credentials | ||
inputs: | ||
ruby-version: | ||
description: Ruby version | ||
required: true | ||
rubygems_api_key: | ||
description: RubyGems API key | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ inputs.ruby-version }} | ||
- run: mkdir -p ~/.gem | ||
shell: bash | ||
- run: | | ||
cat <<-YAML > ~/.gem/credentials | ||
--- | ||
:rubygems_api_key: ${{ inputs.rubygems_api_key }} | ||
YAML | ||
shell: bash | ||
- run: chmod 0600 ~/.gem/credentials | ||
shell: bash |
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,21 @@ | ||
name: Test | ||
description: Run tests | ||
inputs: | ||
ruby-version: | ||
description: Ruby version | ||
required: true | ||
activesupport-version: | ||
description: ActiveSupport version constraint | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ inputs.ruby-version }} | ||
- run: gem install activesupport -v "~> ${{ inputs.activesupport-version }}" | ||
shell: bash | ||
- run: bundle install | ||
shell: bash | ||
- run: bundle exec rake | ||
shell: bash |
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,42 @@ | ||
name: Test and Release | ||
on: | ||
pull_request: | ||
push: | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
test: | ||
name: >- | ||
Ruby ${{ matrix.ruby }}, ActiveSupport ~> ${{ matrix.activesupport }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
activesupport: | ||
- "3.2" | ||
- "4.0" | ||
- "5.0" | ||
- "6.0" | ||
- "7.0" | ||
ruby: | ||
- "3.1" | ||
- "3.2" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/test | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
activesupport-version: ${{ matrix.activesupport }} | ||
push: | ||
if: ${{ github.event.release }} | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-rubygems | ||
with: | ||
ruby-version: "3.2" | ||
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} | ||
- run: bundle install | ||
- run: bundle exec rake gem:push |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.rbc | ||
.bundle | ||
.config | ||
.ruby-version | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,31 @@ | ||
#!/usr/bin/env rake | ||
require "bundler/gem_tasks" | ||
require 'bundler/gem_tasks' | ||
|
||
task :default => :test | ||
|
||
require 'rake/testtask' | ||
Rake::TestTask.new do |t| | ||
t.libs << "test" | ||
t.libs << 'test' | ||
t.test_files = FileList['test/*test.rb'] | ||
t.verbose = true | ||
t.verbose = true | ||
end | ||
|
||
task :default => :test | ||
namespace :gem do | ||
require 'bundler/gem_tasks' | ||
|
||
@gem = "pkg/configs-#{ Configs::VERSION }.gem" | ||
|
||
desc "Push #{ @gem } to rubygems.org" | ||
task :push => %i[test build git:check] do | ||
sh %{gem push #{ @gem }} | ||
end | ||
end | ||
|
||
namespace :git do | ||
desc 'Check git workspace' | ||
task :check do | ||
sh %{git diff HEAD --quiet} do |ok| | ||
abort "\e[31mRefusing to continue - git workspace is dirty\e[0m" unless ok | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -2,20 +2,23 @@ | |
require File.expand_path('../lib/configs/version', __FILE__) | ||
|
||
Gem::Specification.new do |gem| | ||
gem.authors = ["Lance Ivy"] | ||
gem.email = ["[email protected]"] | ||
gem.authors = ['Lance Ivy'] | ||
gem.email = ['[email protected]'] | ||
gem.description = "Easy (easier?) management of config/*.yml files. Defines a lookup priority for the current environment's settings." | ||
gem.summary = "Easy (easier?) management of config/*.yml files." | ||
gem.homepage = "http://github.com/kickstarter/configs" | ||
gem.summary = 'Easy (easier?) management of config/*.yml files.' | ||
gem.homepage = 'http://github.com/kickstarter/configs' | ||
|
||
gem.files = `git ls-files`.split($\) | ||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } | ||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) | ||
gem.name = "configs" | ||
gem.require_paths = ["lib"] | ||
gem.name = 'configs' | ||
gem.require_paths = ['lib'] | ||
gem.version = Configs::VERSION | ||
gem.license = 'MIT' | ||
|
||
gem.add_dependency 'activesupport', '>3.0' | ||
gem.add_development_dependency "rake" | ||
gem.add_dependency 'activesupport', '> 3.0' | ||
gem.add_development_dependency 'minitest', '~> 4.0' | ||
gem.add_development_dependency 'rake' | ||
|
||
gem.required_ruby_version = '~> 3.1' | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.