Skip to content

Commit

Permalink
[CI] Migrates tests to GitHub actions, removes Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 1, 2020
1 parent df87fef commit 2de6778
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 97 deletions.
15 changes: 0 additions & 15 deletions .ci/travis_before_script.sh

This file was deleted.

13 changes: 5 additions & 8 deletions .github/workflows/tests.yml → .github/workflows/2.4.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: master
name: Ruby 2.4
on:
push:
branches:
- master
- 6.x
pull_request:
branches:
- master
- 6.x
jobs:
test-master:
tests:
env:
TEST_ES_SERVER: http://localhost:9200
RAILS_VERSIONS: '5.0'
strategy:
fail-fast: false
matrix:
ruby: [ 2.5, 2.6, 2.7, jruby ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -27,10 +24,10 @@ jobs:
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.8.0
stack-version: 7.9.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: 2.4
- name: Bundle
run: |
sudo apt-get install libsqlite3-dev
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/2.5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Ruby 2.5
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
env:
TEST_ES_SERVER: http://localhost:9200
RAILS_VERSIONS: '5.0,6.0'
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Increase system limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.9.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
- name: Bundle
run: |
sudo apt-get install libsqlite3-dev
gem install bundler
bundle install
bundle exec rake bundle:clean
bundle exec rake bundle:install
- name: Test
run: bundle exec rake test:all

40 changes: 40 additions & 0 deletions .github/workflows/2.6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Ruby 2.6
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
env:
TEST_ES_SERVER: http://localhost:9200
RAILS_VERSIONS: '5.0,6.0'
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Increase system limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.9.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Bundle
run: |
sudo apt-get install libsqlite3-dev
gem install bundler
bundle install
bundle exec rake bundle:clean
bundle exec rake bundle:install
- name: Test
run: bundle exec rake test:all

40 changes: 40 additions & 0 deletions .github/workflows/2.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Ruby 2.7
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
env:
TEST_ES_SERVER: http://localhost:9200
RAILS_VERSIONS: '5.0,6.0'
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Increase system limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.9.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Bundle
run: |
sudo apt-get install libsqlite3-dev
gem install bundler
bundle install
bundle exec rake bundle:clean
bundle exec rake bundle:install
- name: Test
run: bundle exec rake test:all

40 changes: 40 additions & 0 deletions .github/workflows/jruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: JRuby
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
env:
TEST_ES_SERVER: http://localhost:9200
RAILS_VERSIONS: '5.0'
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Increase system limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.9.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: jruby-9.2
- name: Bundle
run: |
sudo apt-get install libsqlite3-dev
gem install bundler
bundle install
bundle exec rake bundle:clean
bundle exec rake bundle:install
- name: Test
run: bundle exec rake test:all

71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Elasticsearch

[![Build Status](https://travis-ci.org/elastic/elasticsearch-rails.svg?branch=master)](https://travis-ci.org/elastic/elasticsearch-rails) [![Code Climate](https://codeclimate.com/github/elastic/elasticsearch-rails/badges/gpa.svg)](https://codeclimate.com/github/elastic/elasticsearch-rails)
[![Ruby 2.7](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.7/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
[![Ruby 2.6](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.6/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
[![Ruby 2.5](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.5/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
[![Ruby 2.4](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.4/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
[![JRuby](https://github.com/elastic/elasticsearch-rails/workflows/JRuby/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
[![Code Climate](https://codeclimate.com/github/elastic/elasticsearch-rails/badges/gpa.svg)](https://codeclimate.com/github/elastic/elasticsearch-rails)

This repository contains various Ruby and Rails integrations for [Elasticsearch](http://elasticsearch.org):

Expand Down
6 changes: 4 additions & 2 deletions elasticsearch-model/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace :bundle do
desc 'Install dependencies for all the Gemfiles in /gemfiles. Optionally define env variable RAILS_VERSIONS. E.g. RAILS_VERSIONS=3.0,5.0'
task :install do
unless defined?(JRUBY_VERSION)
puts '-'*80
puts '-' * 80
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map { |v| "#{v}.gemfile"} : GEMFILES
gemfiles.each do |gemfile|
puts "GEMFILE: #{gemfile}"
Bundler.with_clean_env do
sh "bundle install --gemfile #{File.expand_path('../gemfiles/'+gemfile, __FILE__)}"
end
puts '-'*80
puts '-' * 80
end
end
end
Expand All @@ -50,6 +51,7 @@ namespace :test do
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map {|v| "#{v}.gemfile"} : GEMFILES
puts '-' * 80
gemfiles.each do |gemfile|
puts "GEMFILE: #{gemfile}"
sh "BUNDLE_GEMFILE='#{File.expand_path("../gemfiles/#{gemfile}", __FILE__)}' " +
" bundle exec rspec"
puts '-' * 80
Expand Down

0 comments on commit 2de6778

Please sign in to comment.