name: Fuzz Testing

on:
  create:
    tags:
      - v*

jobs:
  psalm:
    name: PHP-Fuzzer on PHP ${{ matrix.php-versions }}
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: ['ubuntu-latest']
        php-versions: ['8.4']
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-versions }}
          tools: psalm:4
          coverage: none

      - name: Install Composer dependencies
        uses: "ramsey/composer-install@v3"

      - name: Fuzz Tests
        run: vendor/bin/php-fuzzer --max-runs 1000 fuzz fuzzing/FuzzSodiumCompat.php
