Skip to content

Commit 4f66e7d

Browse files
committed
ci: add psalm check in static-analysis
1 parent eb781d3 commit 4f66e7d

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/static-analysis.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,54 @@ jobs:
8383

8484
- name: 🔍 Run static analysis using phpstan/phpstan
8585
run: composer stan:ci
86+
87+
psalm:
88+
timeout-minutes: 4
89+
runs-on: ${{ matrix.os }}
90+
concurrency:
91+
cancel-in-progress: true
92+
group: psalm-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
93+
strategy:
94+
fail-fast: true
95+
matrix:
96+
os:
97+
- ubuntu-latest
98+
php-version:
99+
- '8.2'
100+
dependencies:
101+
- locked
102+
steps:
103+
- name: 📦 Check out the codebase
104+
uses: actions/[email protected]
105+
106+
- name: 🛠️ Setup PHP
107+
uses: shivammathur/[email protected]
108+
with:
109+
php-version: ${{ matrix.php-version }}
110+
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, fileinfo, xmlwriter, opcache, pcntl, posix, pdo, pdo_mysql, iconv
111+
ini-values: error_reporting=E_ALL
112+
coverage: xdebug
113+
114+
- name: 🛠️ Setup problem matchers
115+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
116+
117+
- name: 🤖 Validate composer.json and composer.lock
118+
run: composer validate --ansi --strict
119+
120+
- name: 🔍 Get composer cache directory
121+
uses: wayofdev/gh-actions/actions/composer/[email protected]
122+
123+
- name: ♻️ Restore cached dependencies installed with composer
124+
uses: actions/[email protected]
125+
with:
126+
path: ${{ env.COMPOSER_CACHE_DIR }}
127+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
128+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
129+
130+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
131+
uses: wayofdev/gh-actions/actions/composer/[email protected]
132+
with:
133+
dependencies: ${{ matrix.dependencies }}
134+
135+
- name: 🔍 Run static analysis using vimeo/psalm
136+
run: composer psalm:ci

0 commit comments

Comments
 (0)