Skip to content

Commit

Permalink
Replace Travis-CI with GHA.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock committed Mar 6, 2022
1 parent a6786f9 commit 69d1647
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 49 deletions.
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/mongodb-github-action@1.7.0
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 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

0 comments on commit 69d1647

Please sign in to comment.