Skip to content

Commit

Permalink
Update workflow.yml & Gemfile
Browse files Browse the repository at this point in the history
1. Add more Ruby versions
2. Cache bundler
3. Add single Windows job
4. Update Gemfile for stdlib -> bundled gems
  • Loading branch information
MSP-Greg committed Feb 14, 2020
1 parent 429f803 commit 8330630
Showing 2 changed files with 76 additions and 23 deletions.
91 changes: 68 additions & 23 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -11,32 +11,77 @@ on:
- 4-stable

jobs:
test:
name: Ruby ${{ matrix.ruby_version }}
ubuntu:
name: ubuntu-latest Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest

strategy:
max-parallel: 3
fail-fast: false
matrix:
ruby_version: [2.4.x, 2.5.x, 2.6.x]
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, ruby-head ]

steps:
- uses: actions/checkout@master
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Setup .netrc
run: |
chmod 600 spec/fixtures/.netrc
- name: Install dependencies
run: |
gem install bundler
gem update bundler
bundle install --without development --jobs 4 --retry 3
- name: Test with RSpec
env:
GITHUB_CI: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
bundle exec rspec
- uses: actions/checkout@master
- name: Cache Ruby dependencies
uses: actions/cache@v1
with:
path: ./vendor/bundle
key: cache-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
restore-keys: |
cache-${{ runner.os }}-${{ matrix.ruby }}-
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup .netrc
run: |
chmod 600 spec/fixtures/.netrc
- name: Install dependencies
run: |
bundle install --path=vendor/bundle --without=development --jobs 4 --retry 3
- name: Test with RSpec
env:
GITHUB_CI: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
bundle exec rspec
mingw:
name: windows-latest Ruby ${{ matrix.ruby }}
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
ruby: [ 2.6 ]

steps:
- uses: actions/checkout@v2
- name: Cache Ruby dependencies
uses: actions/cache@v1
with:
path: ./vendor/bundle
key: cache-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}-
restore-keys: |
cache-${{ runner.os }}-${{ matrix.ruby }}-
- name: Set up Ruby
uses: MSP-Greg/actions-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
base: update
- name: Install dependencies
env:
rv: ${{ matrix.ruby }}
run: |
$abi = ruby -e "print RbConfig::CONFIG['ruby']"
if ($abi -ge '2.7') {
gem i nokogiri -N --platform=ruby -i vendor/bundle/ruby/$abi
}
bundle install --path=vendor/bundle --without=development --jobs 4 --retry 3
- name: Test with RSpec
env:
GITHUB_CI: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
bundle exec rspec
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -3,6 +3,11 @@ source 'https://rubygems.org'
gem 'jruby-openssl', :platforms => :jruby
gem 'rake', '> 11.0.1', '< 12.0'

# when stdlib items become gems, they need to added
install_if -> { RUBY_VERSION >= '2.8' } do
gem 'rss', '>= 0.2.8'
end

group :development do
gem 'awesome_print', :require => 'ap'
gem 'guard-rspec', '~> 4.5'
@@ -13,6 +18,9 @@ group :development do
end

group :test do
install_if -> { RUBY_VERSION >= '2.8' } do
gem 'rexml', '>= 3.2.3'
end
gem 'coveralls', :require => false
gem 'json', '~> 1.7', :platforms => [:jruby]
gem 'jwt', '~> 1.5', '>= 1.5.6'

0 comments on commit 8330630

Please sign in to comment.