name: fuzz

on:
  push:
    branches: [main]
    paths:
      - src/scanner.c
      - dialects/*/src/scanner.c
  pull_request:
    paths:
      - src/scanner.c
      - dialects/*/src/scanner.c

jobs:
  fuzz:
    name: Parser fuzzing
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        directory: [".", "dialects/terraform"]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Run fuzzer
        uses: tree-sitter/fuzz-action@v4
        with:
          directory: ${{matrix.directory}}
