fix: Enforce guard on Access-Control-Allow-Credentials header to prev… #371
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [ master, main, develop ] | |
| pull_request: | |
| branches: [ master, main, develop ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: ['8.1', '8.2', '8.3'] | |
| name: PHP ${{ matrix.php-version }} Tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: mbstring, xml, ctype, json, fileinfo, pdo, pdo_mysql, gd, curl | |
| coverage: xdebug | |
| - name: Validate composer.json | |
| run: composer validate --strict | |
| - name: Clear Composer cache | |
| run: composer clear-cache | |
| - name: Remove vendor directory | |
| run: rm -rf vendor | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction --no-cache --optimize-autoloader | |
| - name: Verify PHPUnit installation | |
| run: | | |
| test -f vendor/phpunit/phpunit/src/Framework/Test.php || (echo "PHPUnit Test.php missing!" && exit 1) | |
| php vendor/bin/phpunit --version | |
| - name: Run Security Tests (Critical) | |
| run: php vendor/bin/phpunit tests/Security/ --no-coverage --colors=never | |
| - name: Run Unit Tests (Optional) | |
| continue-on-error: true | |
| run: php vendor/bin/phpunit tests/Unit/ --no-coverage --colors=never | |
| - name: Run All Tests with Coverage | |
| if: matrix.php-version == '8.3' | |
| run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml | |
| - name: Upload coverage to Codecov | |
| if: matrix.php-version == '8.3' | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false |