|
1 | 1 | name: PHP Static Analysis (Larastan)
|
2 |
| -on: [push, pull_request] |
| 2 | +on: [ push, pull_request ] |
3 | 3 | jobs:
|
4 |
| - test: |
5 |
| - strategy: |
6 |
| - matrix: |
7 |
| - operating-system: |
8 |
| - - ubuntu-22.04 |
9 |
| - php-version: |
10 |
| - - '8.4' |
11 |
| - name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }} |
12 |
| - services: |
13 |
| - mysql: |
14 |
| - image: mysql:8.0 |
15 |
| - env: |
16 |
| - MYSQL_ALLOW_EMPTY_PASSWORD: yes |
17 |
| - MYSQL_DATABASE: unit3d |
18 |
| - ports: |
19 |
| - - 3306:3306 |
20 |
| - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
21 |
| - redis: |
22 |
| - image: redis:5.0 |
23 |
| - ports: |
24 |
| - - 6379:6379 |
25 |
| - options: >- |
26 |
| - --health-cmd "redis-cli ping" |
27 |
| - --health-interval 10s |
28 |
| - --health-timeout 5s |
29 |
| - --health-retries 5 |
30 |
| - runs-on: ${{ matrix.operating-system }} |
31 |
| - steps: |
32 |
| - - name: Checkout |
33 |
| - uses: actions/checkout@v4 |
34 |
| - with: |
35 |
| - fetch-depth: 0 |
36 |
| - - name: Setup PHP 8.4 |
37 |
| - uses: shivammathur/setup-php@v2 |
38 |
| - with: |
39 |
| - php-version: ${{ matrix.php-version }} |
40 |
| - extensions: bcmath, ctype, dom, fileinfo, json, libxml, mbstring, openssl, pdo, tokenizer, xml, zip |
41 |
| - coverage: none |
42 |
| - - name: Install Composer Dependencies |
43 |
| - env: |
44 |
| - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} |
45 |
| - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist |
46 |
| - - name: Prepare The Laravel Environment |
47 |
| - run: cp .env.example .env |
48 |
| - - name: Generate Application Key |
49 |
| - run: php artisan key:generate |
50 |
| - - name: Clear Application Cache |
51 |
| - run: php artisan optimize:clear |
52 |
| - - name: Run Larastan |
53 |
| - run: ./vendor/bin/phpstan analyse -vvv --memory-limit=2G |
54 |
| - - name: Cache phpstan cache directory |
55 |
| - uses: actions/cache@v4 |
56 |
| - with: |
57 |
| - path: .phpstan.cache |
58 |
| - key: "phpstan-cache-${{ github.run_id }}" |
59 |
| - restore-keys: | |
60 |
| - phpstan-cache- |
| 4 | + test: |
| 5 | + strategy: |
| 6 | + matrix: |
| 7 | + operating-system: |
| 8 | + - ubuntu-22.04 |
| 9 | + php-version: |
| 10 | + - '8.4' |
| 11 | + name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }} |
| 12 | + runs-on: ${{ matrix.operating-system }} |
| 13 | + services: |
| 14 | + mysql: |
| 15 | + image: mysql:8.0 |
| 16 | + env: |
| 17 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 18 | + MYSQL_DATABASE: unit3d |
| 19 | + ports: |
| 20 | + - 3306:3306 |
| 21 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 22 | + redis: |
| 23 | + image: redis:5.0 |
| 24 | + ports: |
| 25 | + - 6379:6379 |
| 26 | + options: >- |
| 27 | + --health-cmd "redis-cli ping" |
| 28 | + --health-interval 10s |
| 29 | + --health-timeout 5s |
| 30 | + --health-retries 5 |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + - name: Setup PHP 8.4 |
| 37 | + uses: shivammathur/setup-php@v2 |
| 38 | + with: |
| 39 | + php-version: ${{ matrix.php-version }} |
| 40 | + extensions: bcmath, ctype, dom, fileinfo, json, libxml, mbstring, openssl, pdo, tokenizer, xml, zip |
| 41 | + coverage: none |
| 42 | + - name: Install Composer Dependencies |
| 43 | + env: |
| 44 | + COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} |
| 45 | + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist |
| 46 | + - name: Prepare The Laravel Environment |
| 47 | + run: cp .env.example .env |
| 48 | + - name: Generate Application Key |
| 49 | + run: php artisan key:generate |
| 50 | + - name: Clear Application Cache |
| 51 | + run: php artisan optimize:clear |
| 52 | + - name: Run Larastan |
| 53 | + run: ./vendor/bin/phpstan analyse -vvv --memory-limit=2G |
| 54 | + - name: Cache phpstan cache directory |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: .phpstan.cache |
| 58 | + key: "phpstan-cache-${{ github.run_id }}" |
| 59 | + restore-keys: | |
| 60 | + phpstan-cache- |
0 commit comments