Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions for CI and pushing to RubyGems (#6)
- Loading branch information
Showing
8 changed files
with
90 additions
and
28 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,69 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ruby: | ||
- 2.5 | ||
- 2.6 | ||
- 2.7 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Redis | ||
uses: shogo82148/actions-setup-redis@v1 | ||
with: | ||
redis-version: '5.x' | ||
|
||
- name: Set up Ruby | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
architecture: 'x64' | ||
|
||
- name: Setup bundler | ||
run: | | ||
gem install bundler --no-doc | ||
bundle config path vendor/bundle | ||
- name: Bundler cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Setup gems | ||
run: bundle install --jobs 4 | ||
|
||
- name: Rubocop | ||
run: bundle exec rubocop | ||
|
||
- name: RSpec | ||
run: bundle exec rspec | ||
|
||
publish: | ||
if: contains(github.ref, 'refs/tags/v') | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Release Gem | ||
uses: CvX/publish-rubygems-action@master | ||
env: | ||
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} |
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 |
---|---|---|
|
@@ -9,5 +9,3 @@ | |
Gemfile.lock | ||
.DS_Store | ||
*.swp | ||
|
||
.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml |
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 +1,2 @@ | ||
inherit_from: https://raw.githubusercontent.com/discourse/discourse/master/.rubocop.yml | ||
inherit_gem: | ||
rubocop-discourse: default.yml |
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,3 +1,4 @@ | ||
# frozen_string_literal: true | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
|
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,6 +1,19 @@ | ||
require "bundler/gem_tasks" | ||
#!/usr/bin/env rake | ||
# frozen_string_literal: true | ||
|
||
require "rspec/core/rake_task" | ||
require 'bundler' | ||
|
||
begin | ||
Bundler.setup :default, :development | ||
Bundler::GemHelper.install_tasks | ||
rescue Bundler::BundlerError => error | ||
$stderr.puts error.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit error.status_code | ||
end | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task default: :spec | ||
desc "Default: run tests" | ||
task default: [ :spec ] |
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