From 71bcd84a57af3346e02ff23d61512e59df366a12 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Thu, 13 Feb 2020 10:47:15 -0600 Subject: [PATCH] Split ruby.yml, revise Actions (#2114) --- .github/workflows/ruby.yml | 130 +++++++++++++++++++++++++------------ 1 file changed, 89 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a3c2c3825f..59ead1b598 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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 @@ -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