-
Notifications
You must be signed in to change notification settings - Fork 30
87 lines (75 loc) · 2.88 KB
/
build.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
name: Build
on:
push: ~
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~
jobs:
tests:
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Twig ${{ matrix.twig }}"
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4", "^7.0"]
twig: ["^2.12", "^3.3"]
exclude:
- twig: "^2.12"
symfony: "^7.0"
- php: "8.1"
symfony: "^7.0"
steps:
-
uses: actions/checkout@v4
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
(cd src/Component && composer config extra.symfony.require "${{ matrix.symfony }}")
-
name: Restrict Twig version
if: matrix.twig != ''
run: |
composer require "twig/twig:${{ matrix.twig }}" --no-update --no-scripts
-
name: Install dependencies
run: |
composer update ${{ matrix.composer-flags }} --no-scripts
(cd src/Component && composer update ${{ matrix.composer-flags }} --no-scripts)
-
name: Run analysis
run: |
composer analyse
(cd src/Component && composer validate --strict)
-
name: Run component tests
run: (cd src/Component && vendor/bin/phpspec run)
-
name: Run PHPSpec tests
run: vendor/bin/phpspec run
-
name: Test bundle (with all services)
run: |
rm -rf src/Bundle/test/var/cache
(cd src/Bundle/test && APP_ENV=test bin/console lint:container)
vendor/bin/phpunit
-
name: Run lint container (with no mailers)
run: |
rm -rf src/Bundle/test/var/cache
composer remove symfony/mailer --dev --no-scripts
(cd src/Bundle/test && APP_ENV=test_no_mailers bin/console lint:container)