on: 
  pull_request:
    paths:
      - .github/actions/extism/**
      - .github/workflows/ci-ruby.yml
      - manifest/**
      - runtime/**
      - libextism/**
      - ruby/**
  workflow_dispatch:

name: Ruby CI

jobs:
  ruby:
    name: Ruby
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v3
      - uses: ./.github/actions/extism
      - name: Setup Ruby env
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.0"

      - name: Test Ruby Host SDK
        run: |
          cd ruby
          bundle install
          ruby example.rb
          rake test

