Skip to content

Commit 92938d8

Browse files
committed
[CI] Migrates tests to GitHub actions, removes Travis CI
1 parent cb5e26b commit 92938d8

File tree

9 files changed

+215
-88
lines changed

9 files changed

+215
-88
lines changed

.github/workflows/6.x.yml .github/workflows/2.3.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 6.x
1+
name: Ruby 2.3
22
on:
33
push:
44
branches:
@@ -7,13 +7,12 @@ on:
77
branches:
88
- 6.x
99
jobs:
10-
test-master:
10+
tests:
1111
env:
1212
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '4.0,5.0'
1314
strategy:
1415
fail-fast: false
15-
matrix:
16-
ruby: [ 2.3, 2.4, 2.5, 2.6, 2.7, jruby ]
1716
runs-on: ubuntu-latest
1817
steps:
1918
- uses: actions/checkout@v2
@@ -28,7 +27,7 @@ jobs:
2827
stack-version: 6.8.12
2928
- uses: ruby/setup-ruby@v1
3029
with:
31-
ruby-version: ${{ matrix.ruby }}
30+
ruby-version: 2.3
3231
- name: Bundle
3332
run: |
3433
sudo apt-get install libsqlite3-dev
@@ -38,3 +37,4 @@ jobs:
3837
bundle exec rake bundle:install
3938
- name: Test
4039
run: bundle exec rake test:all
40+

.github/workflows/2.4.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ruby 2.4
2+
on:
3+
push:
4+
branches:
5+
- 6.x
6+
pull_request:
7+
branches:
8+
- 6.x
9+
jobs:
10+
tests:
11+
env:
12+
TEST_ES_SERVER: http://localhost:9200
13+
RAILS_VERSIONS: '4.0,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: 6.8.12
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: 2.4
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.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+
- 6.x
6+
pull_request:
7+
branches:
8+
- 6.x
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: 6.8.12
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+
- 6.x
6+
pull_request:
7+
branches:
8+
- 6.x
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: 6.8.12
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+
- 6.x
6+
pull_request:
7+
branches:
8+
- 6.x
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: 6.8.12
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+
- 6.x
6+
pull_request:
7+
branches:
8+
- 6.x
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: 6.8.12
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

-80
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?branch=6.x)](https://github.com/elastic/elasticsearch-rails/actions)
4+
[![Ruby 2.6](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.6/badge.svg?branch=6.x)](https://github.com/elastic/elasticsearch-rails/actions)
5+
[![Ruby 2.5](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.5/badge.svg?branch=6.x)](https://github.com/elastic/elasticsearch-rails/actions)
6+
[![Ruby 2.4](https://github.com/elastic/elasticsearch-rails/workflows/Ruby%202.4/badge.svg?branch=6.x)](https://github.com/elastic/elasticsearch-rails/actions)
7+
[![JRuby](https://github.com/elastic/elasticsearch-rails/workflows/JRuby/badge.svg?branch=6.x)](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
@@ -14,13 +14,14 @@ namespace :bundle do
1414
desc 'Install dependencies for all the Gemfiles in /gemfiles. Optionally define env variable RAILS_VERSIONS. E.g. RAILS_VERSIONS=3.0,5.0'
1515
task :install do
1616
unless defined?(JRUBY_VERSION)
17-
puts '-'*80
17+
puts '-' * 80
1818
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map { |v| "#{v}.gemfile"} : GEMFILES
1919
gemfiles.each do |gemfile|
20+
puts "GEMFILE: #{gemfile}"
2021
Bundler.with_clean_env do
2122
sh "bundle install --gemfile #{File.expand_path('../gemfiles/'+gemfile, __FILE__)}"
2223
end
23-
puts '-'*80
24+
puts '-' * 80
2425
end
2526
end
2627
end
@@ -36,6 +37,7 @@ namespace :test do
3637
gemfiles = ENV['RAILS_VERSIONS'] ? ENV['RAILS_VERSIONS'].split(',').map {|v| "#{v}.gemfile"} : GEMFILES
3738
puts '-' * 80
3839
gemfiles.each do |gemfile|
40+
puts "GEMFILE: #{gemfile}"
3941
sh "BUNDLE_GEMFILE='#{File.expand_path("../gemfiles/#{gemfile}", __FILE__)}' " +
4042
" bundle exec rspec"
4143
puts '-' * 80

0 commit comments

Comments
 (0)