Skip to content

Parslet-based parser (#156) #717

Parslet-based parser (#156)

Parslet-based parser (#156) #717

Workflow file for this run

name: rake
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- .github/workflows/release.yml
- .github/workflows/codeql.yml
pull_request:
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
env:
RUBYGEM_VER: 3.4.22
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Rubocop
run: bundle exec rake rubocop
rake:
name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby: [ '3.3', '3.2', '3.1', '3.0', '2.7' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: |
bundle exec rake
cat .rspec_status
rake-alpine:
name: test on ruby-${{ matrix.ruby }} alpine container
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [ '3.3', '3.2', '3.1', '3.0', '2.7' ]
container: ruby:${{ matrix.ruby }}-alpine
steps:
- name: Install packages
run: |
apk --no-cache --upgrade add build-base git bash tar
- name: Checkout
uses: actions/checkout@v4
- name: Upgrade RubyGems
if: matrix.ruby == '3.0' || matrix.ruby == '2.7'
run: gem update --system ${{ env.RUBYGEM_VER }} --no-document
- name: Bundle
run: |
git config --global --add safe.directory $PWD
bundle install --jobs 4 --retry 3
- name: Run tests
run: |
bundle exec rake
cat .rspec_status
# test release workflow
pack-ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Build gem without native extension
run: gem build expressir.gemspec
- name: Package gem without native extension
uses: actions/upload-artifact@v4
with:
name: pkg-ruby
path: expressir-*.gem
pack:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [ linux-gnu, linux-musl, windows, darwin ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Package gem with native extension
uses: actions/upload-artifact@v4
with:
name: pkg-${{ matrix.platform }}
path: pkg/*.gem
verify-ruby:
name: verify ruby gem on ruby-${{ matrix.ruby }} ${{ matrix.os }}
needs: pack-ruby
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby: [ '3.3', '3.2', '3.1', '3.0', '2.7' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Download packaged gem
uses: actions/download-artifact@v4
with:
name: pkg-ruby
path: pkg
- name: Install gem
run: gem install -l pkg/expressir-*.gem
- name: Verify
run: |
cd $(ruby -e "puts Gem::Specification.find_by_name('expressir').gem_dir")
ruby bin/rspec
cat .rspec_status || echo ".rspec_status was not found"