Update run-tests.yml #85
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: run-tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev-main | |
| - 5.x-dev | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ 8.3, 8.4 ] | |
| laravel: [ 13.*, 12.*, 11.* ] | |
| include: | |
| - laravel: 13.* | |
| testbench: 11.* | |
| - laravel: 12.* | |
| testbench: 10.* | |
| - laravel: 11.* | |
| testbench: 9.* | |
| name: P${{ matrix.php }} - L${{ matrix.laravel }} | |
| env: | |
| BROADCAST_DRIVER: log | |
| CACHE_DRIVER: redis | |
| QUEUE_CONNECTION: redis | |
| SESSION_DRIVER: redis | |
| DB_CONNECTION: testing | |
| APP_KEY: base64:2fl+Ktvkfl+Fuz3Qp/A76G2RTiGVA/ZjKZaz6fiiM10= | |
| APP_ENV: testing | |
| BCRYPT_ROUNDS: 10 | |
| MAIL_MAILER: array | |
| TELESCOPE_ENABLED: false | |
| services: | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:8.18.0 | |
| env: | |
| discovery.type: single-node | |
| xpack.security.enabled: 'false' | |
| ES_JAVA_OPTS: '-Xms512m -Xmx512m' | |
| ports: | |
| - 9200:9200 | |
| options: >- | |
| --health-cmd="curl http://localhost:9200/_cluster/health" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| redis: | |
| image: redis | |
| ports: | |
| - 6379/tcp | |
| options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Verify Elasticsearch connection | |
| run: | | |
| curl -X GET "localhost:${{ job.services.elasticsearch.ports['9200'] }}/_cluster/health?pretty=true" | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: xdebug | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, mysql | |
| - name: Allow Laravel 11 to resolve | |
| if: matrix.laravel == '11.*' | |
| # Laravel 11 is past its security window, so three advisories now cover | |
| # the whole branch with no 11.x release that clears them. Composer 2.9+ | |
| # blocks advisory-affected versions during resolution, which makes the | |
| # row unrunnable rather than red. Report them instead of blocking. | |
| run: composer config --global policy.advisories.block false | |
| - name: Install dependencies | |
| run: | | |
| composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | |
| composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: List Installed Dependencies | |
| run: composer show -D | |
| - name: Run tests | |
| run: vendor/bin/pest --ci | |
| env: | |
| REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | |
| ELASTICSEARCH_PORT: ${{ job.services.elasticsearch.ports['9200'] }} |