-
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.
Migrate Travis to GitHub Actions (#14)
- Loading branch information
Showing
14 changed files
with
126 additions
and
35 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,21 @@ | ||
name: danger | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
danger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6.2" | ||
bundler-cache: true | ||
- uses: MeilCli/danger-action@v5 | ||
with: | ||
danger_file: "Dangerfile" | ||
danger_id: "danger-pr" | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,18 @@ | ||
name: rubocop | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
rubocop: | ||
name: RuboCop | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6.2" | ||
bundler-cache: true | ||
- name: Run RuboCop | ||
run: bundle exec rubocop |
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,35 @@ | ||
--- | ||
name: test-mongodb | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-mongodb: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Firefox | ||
uses: browser-actions/setup-firefox@latest | ||
with: | ||
firefox-version: "54.0" | ||
- name: Download geckodriver | ||
uses: browser-actions/setup-geckodriver@latest | ||
with: | ||
geckodriver-version: "0.18.0" | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6.2" | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: "5" | ||
mongodb-db: slack-ruby-bot-server-stripe_test | ||
- name: Run tests | ||
uses: GabrielBB/xvfb-action@v1 | ||
env: | ||
DATABASE_ADAPTER: mongoid | ||
with: | ||
run: | | ||
bundle install | ||
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,36 @@ | ||
name: test-postgresql | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-postgresql: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Firefox | ||
uses: browser-actions/setup-firefox@latest | ||
with: | ||
firefox-version: "54.0" | ||
- name: Download geckodriver | ||
uses: browser-actions/setup-geckodriver@latest | ||
with: | ||
geckodriver-version: "0.18.0" | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6.2" | ||
- uses: harmon758/postgresql-action@v1 | ||
with: | ||
postgresql version: "14" | ||
postgresql db: slack_ruby_bot_server_stripe__test | ||
postgresql user: test | ||
postgresql password: password | ||
- name: Test | ||
uses: GabrielBB/xvfb-action@v1 | ||
env: | ||
DATABASE_ADAPTER: activerecord | ||
DATABASE_URL: postgres://test:[email protected]:5432/slack_ruby_bot_server_stripe__test | ||
with: | ||
run: | | ||
bundle install | ||
bundle exec rake spec |
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
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,6 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
db_config = YAML.safe_load(File.read(File.expand_path('postgresql.yml', __dir__)), [], [], true)[ENV['RACK_ENV']] | ||
yml = ERB.new(File.read(File.expand_path('postgresql.yml', __dir__))).result | ||
db_config = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') | ||
::YAML.safe_load(yml, aliases: true)[ENV['RACK_ENV']] | ||
else | ||
::YAML.safe_load(yml, [], [], true)[ENV['RACK_ENV']] | ||
end | ||
ActiveRecord::Tasks::DatabaseTasks.create(db_config) | ||
ActiveRecord::Base.establish_connection(db_config) | ||
ActiveRecord::Base.logger.level = :info |
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
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
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,5 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rack/test' | ||
require 'hyperclient' | ||
|
||
module SlackRubyBotServer | ||
|