Skip to content

Commit 9c595c7

Browse files
authored
Merge pull request #112 from dry-rb/github-actions
Setup Github Actions for CI
2 parents 66a5ca2 + dbc75a0 commit 9c595c7

File tree

3 files changed

+54
-48
lines changed

3 files changed

+54
-48
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
tests-mri:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
ruby: ["2.6.x", "2.5.x", "2.4.x"]
12+
include:
13+
- ruby: "2.6.x"
14+
coverage: "true"
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up Ruby
18+
uses: actions/setup-ruby@v1
19+
with:
20+
ruby-version: ${{matrix.ruby}}
21+
- name: Run all tests
22+
env:
23+
COVERAGE: ${{matrix.coverage}}
24+
run: |
25+
gem install bundler
26+
bundle install --jobs 4 --retry 3 --without tools docs
27+
bundle exec rake
28+
- name: Send coverage results
29+
if: "matrix.coverage == 'true'"
30+
run: bundle exec codeclimate-test-reporter
31+
32+
tests-others:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
image: ["jruby:9.2.8", "ruby:rc"]
38+
container:
39+
image: ${{matrix.image}}
40+
steps:
41+
- uses: actions/checkout@v1
42+
- name: Install git
43+
run: |
44+
apt-get update
45+
apt-get install -y --no-install-recommends git
46+
- name: Run all tests
47+
run: |
48+
gem install bundler
49+
bundle install --jobs 4 --retry 3 --without tools docs
50+
bundle exec rspec

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

spec/spec_helper.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44

55
SPEC_ROOT = Pathname(__FILE__).dirname
66

7-
if RUBY_ENGINE == 'ruby' && ENV['COVERAGE'] == 'true'
8-
require 'yaml'
9-
rubies = YAML.load(File.read(File.join(__dir__, '..', '.travis.yml')))['rvm']
10-
latest_mri = rubies.select { |v| v =~ /\A\d+\.\d+.\d+\z/ }.max
11-
12-
if RUBY_VERSION == latest_mri
13-
require 'simplecov'
14-
SimpleCov.start do
15-
add_filter '/spec/'
16-
end
7+
if ENV['COVERAGE'] == 'true'
8+
require 'simplecov'
9+
SimpleCov.start do
10+
add_filter '/spec/'
1711
end
1812
end
1913

0 commit comments

Comments
 (0)