Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Travis-CI with GHA. #142

Merged
merged 1 commit into from
Mar 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: danger
on: [pull_request]
jobs:
danger:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Run Danger
run: |
# the personal token is public, this is ok, base64 encode to avoid tripping Github
TOKEN=$(echo -n NWY1ZmM5MzEyMzNlYWY4OTZiOGU3MmI3MWQ3Mzk0MzgxMWE4OGVmYwo= | base64 --decode)
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
16 changes: 16 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: test
on: [push, pull_request]
jobs:
lint:
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run RuboCop
run: bundle exec rubocop
32 changes: 32 additions & 0 deletions .github/workflows/test-mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
entry:
- { ruby: 2.6.2, mongoid: 6.4.8, mongodb: 4.4 }
- { ruby: 2.6.2, mongoid: 7.2.3, mongodb: 4.4 }
- { ruby: 2.6.2, mongoid: 7.3.0, mongodb: 4.4 }
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }})
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
- uses: browser-actions/setup-geckodriver@latest
- run: geckodriver --version
- uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.entry.mongodb }}
- name: Test
uses: GabrielBB/xvfb-action@v1
env:
DATABASE_ADAPTER: mongoid
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
with:
run: |
bundle install
bundle exec rake spec
33 changes: 33 additions & 0 deletions .github/workflows/test-postgresql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
entry:
- { ruby: 2.6.2, postgresql: 11 }
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }})
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
- uses: browser-actions/setup-geckodriver@latest
- run: geckodriver --version
- uses: harmon758/postgresql-action@v1
with:
postgresql version: ${{ matrix.entry.postgresql }}
postgresql db: slack_ruby_bot_server_test
postgresql user: test
postgresql password: password
- name: Test
uses: GabrielBB/xvfb-action@v1
env:
DATABASE_ADAPTER: activerecord
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test
with:
run: |
bundle install
bundle exec rake spec
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#### 1.2.1 (Next)

* [#140](https://github.com/slack-ruby/slack-ruby-bot-server/pull/140): Fix: `NameError` for `Boolean` types with mongoid >= 7.3.0 - [@dblock](https://github.com/dblock).
* [#142](https://github.com/slack-ruby/slack-ruby-bot-server/pull/142): Replace Travis-CI with GitHub Actions - [@dblock](https://github.com/dblock).
* Your contribution here.

#### 1.2.0 (2020/11/27)
Expand Down
47 changes: 24 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@ Slack Ruby Bot Server
=====================

[![Gem Version](https://badge.fury.io/rb/slack-ruby-bot-server.svg)](https://badge.fury.io/rb/slack-ruby-bot-server)
[![Build Status](https://travis-ci.org/slack-ruby/slack-ruby-bot-server.svg?branch=master)](https://travis-ci.org/slack-ruby/slack-ruby-bot-server)
[![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-bot-server.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-bot-server)

Build a complete Slack bot service with Slack button integration, in Ruby.

## Table of Contents

- [What is this?](#what-is-this)
- [Stable Release](#stable-release)
- [Make Your Own](#make-your-own)
- [Usage](#usage)
- [Storage](#storage)
- [MongoDB](#mongodb)
- [ActiveRecord](#activerecord)
- [OAuth Version and Scopes](#oauth-version-and-scopes)
- [Slack App](#slack-app)
- [API](#api)
- [App](#app)
- [Service Manager](#service-manager)
- [Lifecycle Callbacks](#lifecycle-callbacks)
- [Service Timers](#service-timers)
- [Extensions](#extensions)
- [Service Class](#service-class)
- [HTML Templates](#html-templates)
- [Access Tokens](#access-tokens)
- [Sample Bots Using Slack Ruby Bot Server](#sample-bots-using-slack-ruby-bot-server)
- [Slack Bots with Granular Permissions](#slack-bots-with-granular-permissions)
- [Legacy Slack Bots](#legacy-slack-bots)
- [Copyright & License](#copyright--license)
- [Slack Ruby Bot Server](#slack-ruby-bot-server)
- [Table of Contents](#table-of-contents)
- [What is this?](#what-is-this)
- [Stable Release](#stable-release)
- [Make Your Own](#make-your-own)
- [Usage](#usage)
- [Storage](#storage)
- [MongoDB](#mongodb)
- [ActiveRecord](#activerecord)
- [OAuth Version and Scopes](#oauth-version-and-scopes)
- [Slack App](#slack-app)
- [API](#api)
- [App](#app)
- [Service Manager](#service-manager)
- [Lifecycle Callbacks](#lifecycle-callbacks)
- [Service Timers](#service-timers)
- [Extensions](#extensions)
- [Service Class](#service-class)
- [HTML Templates](#html-templates)
- [Access Tokens](#access-tokens)
- [Sample Bots Using Slack Ruby Bot Server](#sample-bots-using-slack-ruby-bot-server)
- [Slack Bots with Granular Permissions](#slack-bots-with-granular-permissions)
- [Legacy Slack Bots](#legacy-slack-bots)
- [Copyright & License](#copyright--license)

## What is this?

Expand Down
6 changes: 5 additions & 1 deletion spec/database_adapters/activerecord/activerecord.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
db_config = YAML.safe_load(File.read(File.expand_path('config/postgresql.yml', __dir__)), [], [], true)[ENV['RACK_ENV']]
db_config = YAML.safe_load(
ERB.new(File.read(
File.expand_path('config/postgresql.yml', __dir__)
)).result, [], [], true
)[ENV['RACK_ENV']]
ActiveRecord::Tasks::DatabaseTasks.create(db_config)
ActiveRecord::Base.establish_connection(db_config)
ActiveRecord::Base.logger.level = :info
1 change: 1 addition & 0 deletions spec/database_adapters/activerecord/config/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ development:

test:
<<: *default
url: <%= ENV["DATABASE_URL"] %>
database: slack_ruby_bot_server_test

production:
Expand Down