Skip to content

Commit 2de6778

Browse files
committed
[CI] Migrates tests to GitHub actions, removes Travis CI
1 parent df87fef commit 2de6778

File tree

9 files changed

+175
-97
lines changed

9 files changed

+175
-97
lines changed

.ci/travis_before_script.sh

-15
This file was deleted.

.github/workflows/tests.yml renamed to .github/workflows/2.4.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
name: master
1+
name: Ruby 2.4
22
on:
33
push:
44
branches:
55
- master
6-
- 6.x
76
pull_request:
87
branches:
98
- master
10-
- 6.x
119
jobs:
12-
test-master:
10+
tests:
1311
env:
1412
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '5.0'
1514
strategy:
1615
fail-fast: false
17-
matrix:
18-
ruby: [ 2.5, 2.6, 2.7, jruby ]
1916
runs-on: ubuntu-latest
2017
steps:
2118
- uses: actions/checkout@v2
@@ -27,10 +24,10 @@ jobs:
2724
sudo sysctl -w vm.max_map_count=262144
2825
- uses: elastic/elastic-github-actions/elasticsearch@master
2926
with:
30-
stack-version: 7.8.0
27+
stack-version: 7.9.0
3128
- uses: ruby/setup-ruby@v1
3229
with:
33-
ruby-version: ${{ matrix.ruby }}
30+
ruby-version: 2.4
3431
- name: Bundle
3532
run: |
3633
sudo apt-get install libsqlite3-dev

.github/workflows/2.5.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ruby 2.5
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
tests:
11+
env:
12+
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '5.0,6.0'
14+
strategy:
15+
fail-fast: false
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Increase system limits
20+
run: |
21+
sudo swapoff -a
22+
sudo sysctl -w vm.swappiness=1
23+
sudo sysctl -w fs.file-max=262144
24+
sudo sysctl -w vm.max_map_count=262144
25+
- uses: elastic/elastic-github-actions/elasticsearch@master
26+
with:
27+
stack-version: 7.9.0
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: 2.5
31+
- name: Bundle
32+
run: |
33+
sudo apt-get install libsqlite3-dev
34+
gem install bundler
35+
bundle install
36+
bundle exec rake bundle:clean
37+
bundle exec rake bundle:install
38+
- name: Test
39+
run: bundle exec rake test:all
40+

.github/workflows/2.6.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ruby 2.6
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
tests:
11+
env:
12+
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '5.0,6.0'
14+
strategy:
15+
fail-fast: false
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Increase system limits
20+
run: |
21+
sudo swapoff -a
22+
sudo sysctl -w vm.swappiness=1
23+
sudo sysctl -w fs.file-max=262144
24+
sudo sysctl -w vm.max_map_count=262144
25+
- uses: elastic/elastic-github-actions/elasticsearch@master
26+
with:
27+
stack-version: 7.9.0
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: 2.6
31+
- name: Bundle
32+
run: |
33+
sudo apt-get install libsqlite3-dev
34+
gem install bundler
35+
bundle install
36+
bundle exec rake bundle:clean
37+
bundle exec rake bundle:install
38+
- name: Test
39+
run: bundle exec rake test:all
40+

.github/workflows/2.7.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ruby 2.7
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
tests:
11+
env:
12+
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '5.0,6.0'
14+
strategy:
15+
fail-fast: false
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Increase system limits
20+
run: |
21+
sudo swapoff -a
22+
sudo sysctl -w vm.swappiness=1
23+
sudo sysctl -w fs.file-max=262144
24+
sudo sysctl -w vm.max_map_count=262144
25+
- uses: elastic/elastic-github-actions/elasticsearch@master
26+
with:
27+
stack-version: 7.9.0
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: 2.7
31+
- name: Bundle
32+
run: |
33+
sudo apt-get install libsqlite3-dev
34+
gem install bundler
35+
bundle install
36+
bundle exec rake bundle:clean
37+
bundle exec rake bundle:install
38+
- name: Test
39+
run: bundle exec rake test:all
40+

.github/workflows/jruby.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: JRuby
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
tests:
11+
env:
12+
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '5.0'
14+
strategy:
15+
fail-fast: false
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Increase system limits
20+
run: |
21+
sudo swapoff -a
22+
sudo sysctl -w vm.swappiness=1
23+
sudo sysctl -w fs.file-max=262144
24+
sudo sysctl -w vm.max_map_count=262144
25+
- uses: elastic/elastic-github-actions/elasticsearch@master
26+
with:
27+
stack-version: 7.9.0
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: jruby-9.2
31+
- name: Bundle
32+
run: |
33+
sudo apt-get install libsqlite3-dev
34+
gem install bundler
35+
bundle install
36+
bundle exec rake bundle:clean
37+
bundle exec rake bundle:install
38+
- name: Test
39+
run: bundle exec rake test:all
40+

.travis.yml

-71
This file was deleted.

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Elasticsearch
22

3-
[![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)
3+
[![Ruby 2.7](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.7/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
4+
[![Ruby 2.6](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.6/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
5+
[![Ruby 2.5](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.5/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
6+
[![Ruby 2.4](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.4/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
7+
[![JRuby](https://github.com/elastic/elasticsearch-rails/workflows/JRuby/badge.svg)](https://github.com/elastic/elasticsearch-rails/actions)
8+
[![Code Climate](https://codeclimate.com/github/elastic/elasticsearch-rails/badges/gpa.svg)](https://codeclimate.com/github/elastic/elasticsearch-rails)
49

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

elasticsearch-model/Rakefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ namespace :bundle do
2929
desc 'Install dependencies for all the Gemfiles in /gemfiles. Optionally define env variable RAILS_VERSIONS. E.g. RAILS_VERSIONS=3.0,5.0'
3030
task :install do
3131
unless defined?(JRUBY_VERSION)
32-
puts '-'*80
32+
puts '-' * 80
3333
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map { |v| "#{v}.gemfile"} : GEMFILES
3434
gemfiles.each do |gemfile|
35+
puts "GEMFILE: #{gemfile}"
3536
Bundler.with_clean_env do
3637
sh "bundle install --gemfile #{File.expand_path('../gemfiles/'+gemfile, __FILE__)}"
3738
end
38-
puts '-'*80
39+
puts '-' * 80
3940
end
4041
end
4142
end
@@ -50,6 +51,7 @@ namespace :test do
5051
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map {|v| "#{v}.gemfile"} : GEMFILES
5152
puts '-' * 80
5253
gemfiles.each do |gemfile|
54+
puts "GEMFILE: #{gemfile}"
5355
sh "BUNDLE_GEMFILE='#{File.expand_path("../gemfiles/#{gemfile}", __FILE__)}' " +
5456
" bundle exec rspec"
5557
puts '-' * 80

0 commit comments

Comments
 (0)