Skip to content

Reduce cost of extractModeEncoding #20

Reduce cost of extractModeEncoding

Reduce cost of extractModeEncoding #20

Workflow file for this run

name: ubuntu
on: [push, pull_request]
jobs:
ruby-versions:
if: ${{ startsWith(github.repository, 'ruby/') || github.event_name != 'schedule' }}
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby
min_version: 2.7
versions: '["debug", "jruby-head", "truffleruby-head"]'
build:
needs: ruby-versions
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
steps:
- name: git config
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global advice.detachedHead 0
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Compile
run: bundle exec rake compile
- name: Build gem
run: bundle exec rake build
- uses: actions/upload-artifact@v4
if: >-
matrix.os == 'ubuntu-24.04' &&
(matrix.ruby == needs.ruby-versions.outputs.latest || matrix.ruby == 'jruby-head')
with:
name: gem-${{ matrix.os }}-${{ matrix.ruby }}
path: pkg/
id: upload
- name: Upload gems
if: >-
startsWith(github.ref, 'refs/tags/') &&
steps.upload.outcome == 'success'
run: |
gh release upload ${GITHUB_REF_NAME} \
pkg/*.gem
env:
GH_TOKEN: ${{ github.token }}
- name: Run test
# Tests don't pass yet on truffleruby
if: >-
matrix.ruby != 'truffleruby-head'
run: bundle exec rake
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
- name: Install gem
run: |
gem install pkg/*.gem
ruby -rstringio -e 'puts StringIO::VERSION'