-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (117 loc) · 3.19 KB
/
tests.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Tests
on: [push, pull_request]
jobs:
test-format:
name: 'Code format check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer format
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- run: git status
- run: git diff-files --quiet --exit-code
test-static:
name: 'Static analysis check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer analyze
test-basic:
name: 'Basic test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit tests
env:
MYSQLI_HOST: localhost:${{ job.services.mysql.ports['3306'] }}
tests:
name: 'PHP ${{ matrix.php-versions }} Twig ${{ matrix.twig }} tests'
needs:
- test-format
- test-static
- test-basic
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
twig:
- 2
- 3
exclude:
# Twig 2 is EOL and breaks in 8.4
- php-versions: 8.4
twig: 2
# Twig 3 doesn't support < 8.1
- php-versions: 7.4
twig: 3
- php-versions: 8.0
twig: 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: ${{ matrix.twig }}-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require twig/twig ^${{ matrix.twig }}
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit --no-coverage tests