|
29 | 29 | - name: Validate PSR-12 Code Style |
30 | 30 | run: ~/.composer/vendor/bin/phpcs |
31 | 31 |
|
32 | | - validate-code-static: |
33 | | - name: Static Code with PHP ${{ matrix.php-versions }} |
34 | | - runs-on: ubuntu-latest |
35 | | - env: |
36 | | - extensions: mbstring, intl, json, phalcon, mongodb |
37 | | - key: cache-v0.0.2 |
38 | | - needs: validate-code-style |
39 | | - strategy: |
40 | | - fail-fast: false |
41 | | - matrix: |
42 | | - php-versions: ['8.1', '8.2', '8.3', '8.4'] |
43 | | - |
44 | | - steps: |
45 | | - - name: Checkout the code |
46 | | - uses: actions/checkout@v5 |
47 | | - |
48 | | - - name: Setup cache environment |
49 | | - id: cache-env |
50 | | - uses: shivammathur/cache-extensions@v1 |
51 | | - with: |
52 | | - php-version: ${{ matrix.php-versions }} |
53 | | - extensions: ${{ env.extensions }} |
54 | | - key: ${{ env.key }} |
55 | | - |
56 | | - - name: Cache extensions |
57 | | - uses: actions/cache@v3 |
58 | | - with: |
59 | | - path: ${{ steps.cache-env.outputs.dir }} |
60 | | - key: ${{ steps.cache-env.outputs.key }} |
61 | | - restore-keys: ${{ steps.cache-env.outputs.key }} |
62 | | - |
63 | | - - name: Setup PHP |
64 | | - uses: shivammathur/setup-php@v2 |
65 | | - with: |
66 | | - coverage: none |
67 | | - php-version: ${{ matrix.php-versions }} |
68 | | - extensions: ${{ env.extensions }} |
69 | | - tools: pecl |
70 | | - |
71 | | - - name: Get Composer Cache Directory |
72 | | - id: composer-cache |
73 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
74 | | - |
75 | | - - name: Cache composer dependencies |
76 | | - uses: actions/cache@v3 |
77 | | - with: |
78 | | - path: ${{ steps.composer-cache.outputs.dir }} |
79 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
80 | | - restore-keys: ${{ runner.os }}-composer- |
81 | | - |
82 | | - - run: composer require --prefer-dist |
83 | | - |
84 | | - - name: Run Psalm |
85 | | - if: always() |
86 | | - run: vendor/bin/psalm |
87 | | - |
88 | | - - name: Run PHPStan |
89 | | - if: always() |
90 | | - run: vendor/bin/phpstan analyse src |
91 | | - |
92 | | - run-tests: |
93 | | - name: Tests with PHP ${{ matrix.php-versions }} |
| 32 | + validate-and-test: |
| 33 | + name: Static Analysis & Tests with PHP ${{ matrix.php-versions }} |
94 | 34 | runs-on: ubuntu-latest |
95 | 35 | env: |
96 | 36 | extensions: mbstring, intl, json, phalcon, redis, mongodb, xdebug |
@@ -145,6 +85,14 @@ jobs: |
145 | 85 | - name: Install Composer dependencies |
146 | 86 | run: composer install --prefer-dist --no-suggest |
147 | 87 |
|
| 88 | + - name: Run Psalm |
| 89 | + if: always() |
| 90 | + run: vendor/bin/psalm |
| 91 | + |
| 92 | + - name: Run PHPStan |
| 93 | + if: always() |
| 94 | + run: vendor/bin/phpstan analyse src |
| 95 | + |
148 | 96 | - name: Run test suites |
149 | 97 | if: success() |
150 | 98 | run: vendor/bin/phpunit --coverage-clover=coverage-${{ matrix.php-versions }}.xml |
|
0 commit comments