Skip to content

Commit 9801051

Browse files
committed
Merge 'validate-code-static' and 'run-tests' jobs into single matrix
1 parent fd5470e commit 9801051

1 file changed

Lines changed: 10 additions & 62 deletions

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -29,68 +29,8 @@ jobs:
2929
- name: Validate PSR-12 Code Style
3030
run: ~/.composer/vendor/bin/phpcs
3131

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 }}
9434
runs-on: ubuntu-latest
9535
env:
9636
extensions: mbstring, intl, json, phalcon, redis, mongodb, xdebug
@@ -145,6 +85,14 @@ jobs:
14585
- name: Install Composer dependencies
14686
run: composer install --prefer-dist --no-suggest
14787

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+
14896
- name: Run test suites
14997
if: success()
15098
run: vendor/bin/phpunit --coverage-clover=coverage-${{ matrix.php-versions }}.xml

0 commit comments

Comments
 (0)