Skip to content

Commit

Permalink
Split ruby.yml, revise Actions (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Feb 13, 2020
1 parent a391634 commit 71bcd84
Showing 1 changed file with 89 additions and 41 deletions.
130 changes: 89 additions & 41 deletions .github/workflows/ruby.yml
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
build:
name: >-
${{ matrix.os }} Ruby: ${{ matrix.ruby }}
${{ matrix.os }}, ${{ matrix.ruby }}
env:
CI: true
TESTOPTS: -v
Expand All @@ -14,45 +14,93 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, macos, windows-latest ]
ruby: [ 2.3, 2.4, 2.5, 2.6, 2.7 ]
exclude:
- os: windows-latest
ruby: 2.3
os: [ ubuntu-18.04, macos ]
ruby: [ 2.3, 2.4, 2.5, 2.6, 2.7, ruby-head ]

steps:
- name: repo checkout
uses: actions/checkout@v2

- name: load ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: ubuntu & macos - install ragel
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
run: |
if [ "${{ matrix.os }}" == "macos" ]; then
brew install ragel
else
sudo apt-get -qy install ragel
fi
- name: windows - update MSYS2, openssl, ragel
if: startsWith(matrix.os, 'windows')
uses: MSP-Greg/msys2-action@master
with:
base: update
mingw: openssl ragel

- name: RubyGems, Bundler Update
run: gem update --system --no-document --conservative
- name: bundle install
run: bundle install --jobs 4 --retry 3
- name: compile
run: bundle exec rake compile
- name: test
run: bundle exec rake
env:
RUBYOPT: --enable-frozen-string-literal
timeout-minutes: 10
- name: repo checkout
uses: actions/checkout@v2

- name: load ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: ubuntu & macos - install ragel
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
run: |
if [ "${{ matrix.os }}" == "macos" ]; then
brew install ragel
else
sudo apt-get -qy install ragel
fi
- name: bundle install
run: bundle install --jobs 4 --retry 3
- name: compile
run: bundle exec rake compile

# two test steps due to pre-installed Bundler not working with
# frozen strings before 2.0

- name: test with frozen string
timeout-minutes: 10
env:
RUBYOPT: --enable-frozen-string-literal
if: matrix.ruby >= '2.6'
run: bundle exec rake

- name: test without frozen string
timeout-minutes: 10
if: matrix.ruby < '2.6'
run: bundle exec rake

win32:
name: >-
${{ matrix.os }}, ${{ matrix.ruby }}
env:
CI: true
TESTOPTS: -v

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
ruby: [ 2.3, 2.4, 2.5, 2.6, 2.7, ruby-head ]

steps:
- name: repo checkout
uses: actions/checkout@v2

- name: windows - update MSYS2, openssl, ragel
if: startsWith(matrix.os, 'windows')
uses: MSP-Greg/actions-ruby@v1
with:
base: update
mingw: openssl ragel
ruby-version: ${{ matrix.ruby }}

- name: bundle install
run: bundle install --jobs 4 --retry 3

- name: compile
if: matrix.ruby >= '2.4'
run: bundle exec rake compile

# Ruby 2.3 uses a OpenSSL package that is not MSYS2
- name: compile
if: matrix.ruby == '2.3'
run: bundle exec rake compile -- --with-openssl-dir=C:/openssl-win

- name: test with frozen string
timeout-minutes: 10
env:
RUBYOPT: --enable-frozen-string-literal
if: matrix.ruby >= '2.6'
run: bundle exec rake

- name: test without frozen string
timeout-minutes: 10
if: matrix.ruby < '2.6'
run: bundle exec rake

0 comments on commit 71bcd84

Please sign in to comment.