-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.94 KB
/
symfony.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
name: Symfony
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
symfony-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.2, 8.3, 8.4 ]
fail-fast: false
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer packages
uses: actions/cache@v4
with:
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
restore-keys: ${{ runner.os }}-composer-
- name: Set npm cache directory
id: npm-cache
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache npm dependencies
uses: actions/cache@v4
with:
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache.outputs.dir }}
restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies
run: |
npm ci
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Build static assets
run: npm run build
- name: Create database and load fixtures
run: |
mkdir -p var
touch var/data.db
php bin/console --env=test doctrine:schema:create --no-interaction
php bin/console --env=test doctrine:fixtures:load --no-interaction
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs -s
- name: Run PHPStan
run: vendor/bin/phpstan analyse --error-format=github
- name: Run PHP Mess Detector
run: vendor/bin/phpmd ./src github phpmd.xml.dist
- name: Execute tests with PHPUnit
run: vendor/bin/phpunit