-
Notifications
You must be signed in to change notification settings - Fork 10
44 lines (41 loc) · 1.21 KB
/
analyze.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Analyze PHP code
on:
push:
branches: [dev, staging, production]
pull_request:
branches: [dev, staging, production]
jobs:
php-analyze:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.2]
steps:
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
id: git-diff
with:
patterns: |
composer.json
composer.lock
**/*.php
- uses: shivammathur/setup-php@v2
if: steps.git-diff.outputs.diff
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Cache Composer packages
if: steps.git-diff.outputs.diff
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('**/composer.lock') }}
- name: Install dependencies
if: steps.git-diff.outputs.diff
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
if: steps.git-diff.outputs.diff
run: echo "CIPHERSWEET_KEY=\"$(openssl rand -hex 32)\"" >> .env
- name: Perform static analysis
if: steps.git-diff.outputs.diff
run: composer analyze