- openspec #98
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: | |
| # Her commit'te ve PR merge edildiğinde çalışır | |
| pull_request: | |
| # Her PR'da çalışır | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.3, 8.4] | |
| laravel: [11.*, 12.*] | |
| database: [mysql, pgsql] | |
| include: | |
| - laravel: 12.* | |
| testbench: 10.* | |
| carbon: ^3 | |
| - laravel: 11.* | |
| testbench: 9.* | |
| carbon: ^2.63 | |
| name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.database }} | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| ports: | |
| - 3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: flexyfield | |
| MYSQL_PASSWORD: flexyfield | |
| MYSQL_USER: flexyfield | |
| MYSQL_DATABASE: flexyfield | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| postgres: | |
| image: postgres:16 | |
| ports: | |
| - 5432 | |
| env: | |
| POSTGRES_USER: flexyfield | |
| POSTGRES_PASSWORD: flexyfield | |
| POSTGRES_DB: flexyfield | |
| options: >- | |
| --health-cmd="pg_isready -U flexyfield" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| --health-retries=3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, pdo_pgsql, bcmath, soap, intl, gd, exif, iconv, fileinfo | |
| coverage: none | |
| - name: Install dependencies | |
| run: | | |
| composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update | |
| composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Execute tests with MySQL | |
| if: matrix.database == 'mysql' | |
| run: vendor/bin/pest --configuration=phpunit.xml.dist | |
| env: | |
| DB_CONNECTION: mysql | |
| DB_HOST: 127.0.0.1 | |
| DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
| DB_USERNAME: flexyfield | |
| DB_PASSWORD: flexyfield | |
| DB_DATABASE: flexyfield | |
| CACHE_DRIVER: array | |
| SESSION_DRIVER: array | |
| QUEUE_DRIVER: sync | |
| - name: Execute tests with PostgreSQL | |
| if: matrix.database == 'pgsql' | |
| run: vendor/bin/pest --configuration=phpunit-postgress.xml.dist | |
| env: | |
| DB_CONNECTION: pgsql | |
| DB_HOST: 127.0.0.1 | |
| DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
| DB_USERNAME: flexyfield | |
| DB_PASSWORD: flexyfield | |
| DB_DATABASE: flexyfield | |
| CACHE_DRIVER: array | |
| SESSION_DRIVER: array | |
| QUEUE_DRIVER: sync | |
| phpstan: | |
| name: PHPStan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| coverage: none | |
| - name: Install dependencies | |
| run: | | |
| composer require "laravel/framework:^11.0" "orchestra/testbench:^9.0" "nesbot/carbon:^2.63" --no-interaction --no-update | |
| composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Run PHPStan | |
| run: ./vendor/bin/phpstan analyse --error-format=github | |
| pint: | |
| name: Pint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| coverage: none | |
| - name: Install dependencies | |
| run: | | |
| composer require "laravel/framework:^11.0" --no-interaction --no-update | |
| composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Run Pint (check) | |
| run: ./vendor/bin/pint --test | |