-
Notifications
You must be signed in to change notification settings - Fork 803
73 lines (63 loc) · 2.36 KB
/
check-php-code.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Check PHP code
on:
workflow_call:
permissions:
contents: read
concurrency:
group: php-unit-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
php:
runs-on: ubuntu-latest
env:
SW_HOST: localhost:8000
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: root
DB_NAME: shopware
MAILER_DSN: smtp://localhost:1025
SW_BASE_PATH: ''
SELENIUM_HOST: localhost
SMTP_HOST: localhost
services:
database:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: shopware
options: '--mount="type=tmpfs,destination=/var/lib/mysql" --health-cmd="mysqladmin ping -h 127.0.0.1" --health-interval=5s --health-timeout=2s --health-retries=3'
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Cache CS-Fixer
uses: actions/cache@v4
with:
path: var/cache/php-cs-fixer
key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('vendor-bin/cs-fixer/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-cs-fixer-
- name: Cache PHPStan
uses: actions/cache@v4
with:
path: var/cache/phpstan
key: ${{ runner.os }}-phpstan-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-phpstan-
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- run: make init
- run: make check-code