name: Fuzz Parser

on:
  push:
    branches: [master]
    paths:
      - php/src/scanner.c
      - php_only/src/scanner.c
      - common/scanner.h
  pull_request:
    paths:
      - php/src/scanner.c
      - php_only/src/scanner.c
      - common/scanner.h

jobs:
  fuzz:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        language: [php, php_only]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5
      - name: Fuzz ${{matrix.language}} parser
        uses: tree-sitter/fuzz-action@v4
        with:
          directory: ${{matrix.language}}
