generated from strangebuzz/MicroSymfony
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (80 loc) · 2.54 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Symfony 6.3 / PHP 8.1
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
# run tests (critical)
symfony-tests:
runs-on: ubuntu-latest
services:
mercure:
image: dunglas/mercure
env:
SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_EXTRA_DIRECTIVES: |
cors_origins http://127.0.0.1:8000
# command: /usr/bin/caddy run --config /etc/caddy/Caddyfile.dev
ports:
- "50943:80"
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug
tools: symfony-cli
- uses: actions/checkout@v3
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Start the local web server (test)
run: symfony serve --daemon --no-tls
- name: Execute tests via PHPUnit
run: make test
# run all lint/cs checks (non critical)
symfony-lint:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: cs2pr
- uses: actions/checkout@v3
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
# native Symfony lints
- name: Lint the DI container
run: bin/console lint:container
- name: Lint Twig templates
run: bin/console lint:twig --env=dev
- name: Lint Yaml files
run: bin/console lint:yaml config/
# vendors
- name: php-cs-fixer
run: vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run --format=checkstyle | cs2pr
- name: PHPStan
run: |
bin/console about --env=dev
vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 1G -vvv