|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + schedule: |
| 9 | + - cron: '0 0 * * *' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + linux_tests: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + services: |
| 17 | + mysql: |
| 18 | + image: mysql:5.7 |
| 19 | + env: |
| 20 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 21 | + MYSQL_DATABASE: forge |
| 22 | + ports: |
| 23 | + - 33306:3306 |
| 24 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 25 | + |
| 26 | + strategy: |
| 27 | + fail-fast: true |
| 28 | + matrix: |
| 29 | + php: [8.2, 8.3] |
| 30 | + phpunit: ['11.0', '11.4'] |
| 31 | + phpstan: ['1.12'] |
| 32 | + paratest: ['7.6'] |
| 33 | + larastan: ['2.5', '2.9'] |
| 34 | + |
| 35 | + name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - with Paratest ${{ matrix.paratest }} - PHPStan ${{ matrix.phpstan }} - Larastan ${{ matrix.larastan }} |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout code |
| 39 | + uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Setup PHP |
| 42 | + uses: shivammathur/setup-php@v2 |
| 43 | + with: |
| 44 | + php-version: ${{ matrix.php }} |
| 45 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp, :php-psr |
| 46 | + ini-values: error_reporting=E_ALL |
| 47 | + tools: composer:v2 |
| 48 | + coverage: none |
| 49 | + env: |
| 50 | + REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 |
| 51 | + REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev |
| 52 | + |
| 53 | + - name: Set Framework version |
| 54 | + run: composer config version "11.x-dev" |
| 55 | + |
| 56 | + - name: Set minimum PHP 8.2 versions |
| 57 | + uses: nick-fields/retry@v3 |
| 58 | + with: |
| 59 | + timeout_minutes: 5 |
| 60 | + max_attempts: 5 |
| 61 | + command: composer require guzzlehttp/psr7:^2.4 --no-interaction --no-update |
| 62 | + |
| 63 | + - name: Set PHPUnit |
| 64 | + uses: nick-fields/retry@v3 |
| 65 | + with: |
| 66 | + timeout_minutes: 5 |
| 67 | + max_attempts: 5 |
| 68 | + command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update |
| 69 | + |
| 70 | + - name: Set Paratest |
| 71 | + uses: nick-fields/retry@v3 |
| 72 | + with: |
| 73 | + timeout_minutes: 5 |
| 74 | + max_attempts: 5 |
| 75 | + command: composer require brianium/paratest:^${{ matrix.paratest }} --dev --no-interaction --with-all-dependencies |
| 76 | + |
| 77 | + - name: Set PHPStan |
| 78 | + uses: nick-fields/retry@v3 |
| 79 | + with: |
| 80 | + timeout_minutes: 5 |
| 81 | + max_attempts: 5 |
| 82 | + command: composer require phpstan/phpstan:^${{ matrix.phpstan }} --dev --no-interaction --no-update |
| 83 | + |
| 84 | + - name: Set Larastan |
| 85 | + uses: nick-fields/retry@v3 |
| 86 | + with: |
| 87 | + timeout_minutes: 5 |
| 88 | + max_attempts: 5 |
| 89 | + command: composer require larastan/larastan:^${{ matrix.larastan }} --dev --no-interaction --no-update |
| 90 | + |
| 91 | + - name: Install dependencies |
| 92 | + uses: nick-fields/retry@v3 |
| 93 | + with: |
| 94 | + timeout_minutes: 5 |
| 95 | + max_attempts: 5 |
| 96 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 97 | + |
| 98 | + - name: Execute tests |
| 99 | + run: php artisan test --parallel --configuration="phpunit.xml" --no-coverage |
| 100 | + env: |
| 101 | + DB_CONNECTION: sqlite |
| 102 | + DB_DATABASE: ":memory:" |
| 103 | + |
| 104 | + - name: Execute PHPStan |
| 105 | + run: vendor/bin/phpstan --configuration="phpstan.neon.dist" |
| 106 | + |
| 107 | + - name: Store artifacts |
| 108 | + uses: actions/upload-artifact@v4 |
| 109 | + with: |
| 110 | + name: linux-logs-${{ matrix.php }}-${{ matrix.phpunit }} |
| 111 | + path: | |
| 112 | + vendor/orchestra/testbench-core/laravel/storage/logs |
| 113 | + !vendor/**/.gitignore |
0 commit comments