name: Bindings Tests (Ruby)
on:
  push:
    paths:
      - bindings/ruby/**
      - src/**/*.c
      - src/**/*.cpp
      - src/**/*.h
      - src/**/*.m
      - src/**/*.metal
      - include/**/*.c
      - include/**/*.cpp
      - include/**/*.h
      - include/**/*.m
      - include/**/*.metal
      - ggml/**/*.c
      - ggml/**/*.cpp
      - ggml/**/*.h
      - ggml/**/*.m
      - ggml/**/*.metal
      - scripts/get-flags.mk
      - examples/dr_wav.h
  pull_request:
    paths:
      - bindings/ruby/**
      - src/**/*.c
      - src/**/*.cpp
      - src/**/*.h
      - src/**/*.m
      - src/**/*.metal
      - include/**/*.c
      - include/**/*.cpp
      - include/**/*.h
      - include/**/*.m
      - include/**/*.metal
      - ggml/**/*.c
      - ggml/**/*.cpp
      - ggml/**/*.h
      - ggml/**/*.m
      - ggml/**/*.metal
      - scripts/get-flags.mk
      - examples/dr_wav.h

jobs:
  ubuntu-latest:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: bindings/ruby
    steps:
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.1'
      - uses: actions/checkout@v4
      - run: rake test
