Skip to content

Commit 4508098

Browse files
authored
Merge pull request #142 from dblock/gha
Replace Travis-CI with GHA.
2 parents a6786f9 + 9be129f commit 4508098

File tree

9 files changed

+130
-73
lines changed

9 files changed

+130
-73
lines changed

.github/workflows/danger.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: danger
3+
on: [pull_request]
4+
jobs:
5+
danger:
6+
runs-on: ubuntu-20.04
7+
steps:
8+
- uses: actions/checkout@v1
9+
- name: Set up Ruby
10+
uses: ruby/setup-ruby@v1
11+
with:
12+
ruby-version: 2.6
13+
bundler-cache: true
14+
- name: Run Danger
15+
run: |
16+
# the personal token is public, this is ok, base64 encode to avoid tripping Github
17+
TOKEN=$(echo -n NWY1ZmM5MzEyMzNlYWY4OTZiOGU3MmI3MWQ3Mzk0MzgxMWE4OGVmYwo= | base64 --decode)
18+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose

.github/workflows/rubocop.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
lint:
6+
name: RuboCop
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: 2.7
14+
bundler-cache: true
15+
- name: Run RuboCop
16+
run: bundle exec rubocop

.github/workflows/test-mongodb.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: 2.6.2, mongoid: 6.4.8, mongodb: 4.4 }
11+
- { ruby: 2.6.2, mongoid: 7.2.3, mongodb: 4.4 }
12+
- { ruby: 2.6.2, mongoid: 7.3.0, mongodb: 4.4 }
13+
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }})
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: ${{ matrix.entry.ruby }}
19+
- uses: browser-actions/setup-geckodriver@latest
20+
- run: geckodriver --version
21+
- uses: supercharge/[email protected]
22+
with:
23+
mongodb-version: ${{ matrix.entry.mongodb }}
24+
- name: Test
25+
uses: GabrielBB/xvfb-action@v1
26+
env:
27+
DATABASE_ADAPTER: mongoid
28+
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
29+
with:
30+
run: |
31+
bundle install
32+
bundle exec rake spec
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: 2.6.2, postgresql: 11 }
11+
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }})
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ${{ matrix.entry.ruby }}
17+
- uses: browser-actions/setup-geckodriver@latest
18+
- run: geckodriver --version
19+
- uses: harmon758/postgresql-action@v1
20+
with:
21+
postgresql version: ${{ matrix.entry.postgresql }}
22+
postgresql db: slack_ruby_bot_server_test
23+
postgresql user: test
24+
postgresql password: password
25+
- name: Test
26+
uses: GabrielBB/xvfb-action@v1
27+
env:
28+
DATABASE_ADAPTER: activerecord
29+
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test
30+
with:
31+
run: |
32+
bundle install
33+
bundle exec rake spec

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#### 1.2.1 (Next)
44

55
* [#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).
6+
* [#142](https://github.com/slack-ruby/slack-ruby-bot-server/pull/142): Replace Travis-CI with GitHub Actions - [@dblock](https://github.com/dblock).
67
* Your contribution here.
78

89
#### 1.2.0 (2020/11/27)

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,36 @@ Slack Ruby Bot Server
22
=====================
33

44
[![Gem Version](https://badge.fury.io/rb/slack-ruby-bot-server.svg)](https://badge.fury.io/rb/slack-ruby-bot-server)
5-
[![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)
65
[![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-bot-server.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-bot-server)
76

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

109
## Table of Contents
1110

12-
- [What is this?](#what-is-this)
13-
- [Stable Release](#stable-release)
14-
- [Make Your Own](#make-your-own)
15-
- [Usage](#usage)
16-
- [Storage](#storage)
17-
- [MongoDB](#mongodb)
18-
- [ActiveRecord](#activerecord)
19-
- [OAuth Version and Scopes](#oauth-version-and-scopes)
20-
- [Slack App](#slack-app)
21-
- [API](#api)
22-
- [App](#app)
23-
- [Service Manager](#service-manager)
24-
- [Lifecycle Callbacks](#lifecycle-callbacks)
25-
- [Service Timers](#service-timers)
26-
- [Extensions](#extensions)
27-
- [Service Class](#service-class)
28-
- [HTML Templates](#html-templates)
29-
- [Access Tokens](#access-tokens)
30-
- [Sample Bots Using Slack Ruby Bot Server](#sample-bots-using-slack-ruby-bot-server)
31-
- [Slack Bots with Granular Permissions](#slack-bots-with-granular-permissions)
32-
- [Legacy Slack Bots](#legacy-slack-bots)
33-
- [Copyright & License](#copyright--license)
11+
- [Slack Ruby Bot Server](#slack-ruby-bot-server)
12+
- [Table of Contents](#table-of-contents)
13+
- [What is this?](#what-is-this)
14+
- [Stable Release](#stable-release)
15+
- [Make Your Own](#make-your-own)
16+
- [Usage](#usage)
17+
- [Storage](#storage)
18+
- [MongoDB](#mongodb)
19+
- [ActiveRecord](#activerecord)
20+
- [OAuth Version and Scopes](#oauth-version-and-scopes)
21+
- [Slack App](#slack-app)
22+
- [API](#api)
23+
- [App](#app)
24+
- [Service Manager](#service-manager)
25+
- [Lifecycle Callbacks](#lifecycle-callbacks)
26+
- [Service Timers](#service-timers)
27+
- [Extensions](#extensions)
28+
- [Service Class](#service-class)
29+
- [HTML Templates](#html-templates)
30+
- [Access Tokens](#access-tokens)
31+
- [Sample Bots Using Slack Ruby Bot Server](#sample-bots-using-slack-ruby-bot-server)
32+
- [Slack Bots with Granular Permissions](#slack-bots-with-granular-permissions)
33+
- [Legacy Slack Bots](#legacy-slack-bots)
34+
- [Copyright & License](#copyright--license)
3435

3536
## What is this?
3637

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
db_config = YAML.safe_load(File.read(File.expand_path('config/postgresql.yml', __dir__)), [], [], true)[ENV['RACK_ENV']]
1+
db_config = YAML.safe_load(
2+
ERB.new(File.read(
3+
File.expand_path('config/postgresql.yml', __dir__)
4+
)).result, [], [], true
5+
)[ENV['RACK_ENV']]
26
ActiveRecord::Tasks::DatabaseTasks.create(db_config)
37
ActiveRecord::Base.establish_connection(db_config)
48
ActiveRecord::Base.logger.level = :info

spec/database_adapters/activerecord/config/postgresql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ development:
1010

1111
test:
1212
<<: *default
13+
url: <%= ENV["DATABASE_URL"] %>
1314
database: slack_ruby_bot_server_test
1415

1516
production:

0 commit comments

Comments
 (0)