Skip to content

Commit

Permalink
Merge pull request #625 from mislav/github-actions
Browse files Browse the repository at this point in the history
Move CI from Travis to GitHub Actions
  • Loading branch information
mislav authored May 5, 2021
2 parents 2a1580c + 1a64d43 commit 07a2647
Show file tree
Hide file tree
Showing 19 changed files with 173 additions and 396 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
name: Test Suite
'on':
- push
- pull_request
jobs:
test-rails:
strategy:
fail-fast: false
matrix:
ruby:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
gemfile:
- Gemfile
- environments/Gemfile.rails5.0.rb
- environments/Gemfile.rails5.1.rb
- environments/Gemfile.rails5.2.rb
- environments/Gemfile.rails6.0.rb
- environments/Gemfile.rails-edge.rb
exclude:
- ruby: '2.4'
gemfile: Gemfile
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.0.rb
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.1.rb
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.2.rb
- ruby: '2.4'
gemfile: environments/Gemfile.rails6.0.rb
- ruby: '2.4'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '2.5'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '2.6'
gemfile: environments/Gemfile.rails-edge.rb
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: will_paginate
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3306:3306
postgres:
image: postgres:11
env:
POSTGRES_DB: will_paginate
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- name: Run tests
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
run: |
docker-wait() {
local container
container="$(docker ps -q -f ancestor=$1)"
timeout 90s bash -c "until docker exec $container $2; do sleep 5; done"
}
docker-wait postgres:11 "pg_isready"
docker-wait mysql:5.7 "mysqladmin ping"
bundler binstubs rspec-core
script/test_all
test-nonrails:
strategy:
fail-fast: false
matrix:
ruby:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: environments/Gemfile.non-rails.rb
services:
mongodb:
image: mongo:4.2
ports:
- 27017:27017
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- name: Run tests
run: |
docker-wait() {
local container
container="$(docker ps -q -f ancestor=$1)"
timeout 90s bash -c "until docker exec $container $2; do sleep 5; done"
}
docker-wait mongo:4.2 "mongo --quiet"
bundler binstubs rspec-core
script/test_all
119 changes: 0 additions & 119 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ How to set up your environment for running tests:

2. Run `script/test_all`

This ensures that the Active Record part of the suite is run across `sqlite3`, `mysql`/`mysql2`, and `postgres` database adapters.
This ensures that the Active Record part of the suite is run across `sqlite3`, `mysql`, and `postgres` database adapters.
19 changes: 0 additions & 19 deletions environments/Gemfile.rails3.0.rb

This file was deleted.

19 changes: 0 additions & 19 deletions environments/Gemfile.rails3.1.rb

This file was deleted.

19 changes: 0 additions & 19 deletions environments/Gemfile.rails3.2.rb

This file was deleted.

17 changes: 0 additions & 17 deletions environments/Gemfile.rails4.0.rb

This file was deleted.

17 changes: 0 additions & 17 deletions environments/Gemfile.rails4.1.rb

This file was deleted.

16 changes: 0 additions & 16 deletions environments/Gemfile.rails4.2.rb

This file was deleted.

6 changes: 3 additions & 3 deletions environments/Gemfile.rails5.0.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

rails_version = '~> 5.0.7.2'
rails_version = '~> 5.0.7'

gem 'activerecord', rails_version
gem 'actionpack', rails_version
Expand All @@ -11,5 +11,5 @@

gem 'sqlite3', '~> 1.3.6'

gem 'mysql2', '~> 0.4.6', :group => :mysql
gem 'pg', '~> 0.11', :group => :pg
gem 'mysql2', '~> 0.5.2', :group => :mysql
gem 'pg', '~> 1.2.3', :group => :pg
2 changes: 1 addition & 1 deletion environments/Gemfile.rails5.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
gem 'sqlite3', '~> 1.3.6'

gem 'mysql2', '~> 0.5.2', :group => :mysql
gem 'pg', '~> 0.18.4', :group => :pg
gem 'pg', '~> 1.2.3', :group => :pg
Loading

0 comments on commit 07a2647

Please sign in to comment.