Skip to content

Commit f85fc1c

Browse files
authored
Use gh actions for ci (#47)
* Upgrade ruby, bundler, and rubocop * Build and test with gh actions * Pin back to old versions for now * Require ruby version in gemspec * Test with a matrix of ruby versions
1 parent d87f43a commit f85fc1c

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and test
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
ruby: [ '2.5', '2.6.x', '2.x']
11+
name: Test gem in ruby version ${{ matrix.ruby }}
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up Ruby ${{ matrix.ruby }}
15+
uses: actions/setup-ruby@v1
16+
with:
17+
ruby-version: ${{ matrix.ruby }}
18+
- name: Build with dependencies
19+
run: |
20+
gem install bundler -v 1.17
21+
bundle install
22+
- name: Test with rspec
23+
run: |
24+
bundle exec rspec spec/
25+
- name: Lint with rubocop
26+
run: |
27+
bundle exec rubocop

vrt.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ Gem::Specification.new do |spec|
1515
spec.license = 'MIT'
1616
spec.files = Dir['lib/**/*.{rb,json}']
1717
spec.require_paths = ['lib']
18+
spec.required_ruby_version = '>= 2.5'
1819

1920
spec.add_development_dependency 'bundler', '~> 1.14'
20-
spec.add_development_dependency 'pry'
21-
spec.add_development_dependency 'rake'
22-
spec.add_development_dependency 'rspec'
21+
spec.add_development_dependency 'pry', '~> 0.11'
22+
spec.add_development_dependency 'rake', '~> 12.3'
23+
spec.add_development_dependency 'rspec', '~> 3.6'
2324
# TODO: investigate why rubocop's jaro-winkler dependency fails to install in our alpine linux image
2425
spec.add_development_dependency 'rubocop', '0.56.0'
2526
end

0 commit comments

Comments
 (0)