1
- name : PHP Composer
1
+ name : Tests
2
2
3
3
on :
4
4
push :
7
7
branches : [ master ]
8
8
9
9
jobs :
10
- build :
11
-
10
+ phpunit :
11
+ name : Tests
12
+ runs-on : ubuntu-latest
12
13
strategy :
13
14
fail-fast : false
14
15
matrix :
15
- # os: [ubuntu-latest, macos-latest, windows-latest]
16
- os : [ubuntu-latest]
17
- php : ['7.1', '7.2', '7.3', '7.4', '8.0']
18
- # max 4.4.16, see https://github.com/symfony/symfony/issues/39521
19
- # max 5.1.8, see https://github.com/symfony/symfony/issues/39521
20
- yaml : ['5.2.9', '5.1.11', '4.4.24', '^3.4']
16
+ php :
17
+ - " 7.1"
18
+ - " 7.2"
19
+ - " 7.3"
20
+ - " 7.4"
21
+ - " 8.0"
22
+ dependencies :
23
+ - " lowest"
24
+ - " highest"
25
+ symfony-yaml : ['^3.4', '^4', '^5']
21
26
exclude :
22
- # Symfony YAML does not run on PHP 7.1
23
- - php : ' 7.1'
24
- yaml : ' 5.1.11'
27
+ # symfony/yaml v5 does not run on PHP 7.1
25
28
- php : ' 7.1'
26
- yaml : ' 5.2.9'
27
- include :
28
- - php : ' 7.4'
29
- os : windows-latest
30
- yaml : ' 5.2.9'
31
- - php : ' 7.4'
32
- os : macos-latest
33
- yaml : ' 5.2.9'
29
+ symfony-yaml : ' ^5'
30
+ # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it
31
+ - php : ' 8.0'
32
+ symfony-yaml : ' ^3.4'
34
33
35
-
36
- runs-on : ${{ matrix.os }}
37
34
env :
38
- YAML : ${{ matrix.yaml }}
35
+ SYMFONY_YAML : ${{ matrix.symfony- yaml }}
39
36
40
37
steps :
41
38
- uses : actions/checkout@v2
@@ -44,60 +41,23 @@ jobs:
44
41
uses : shivammathur/setup-php@v2
45
42
with :
46
43
php-version : ${{ matrix.php }}
47
- ini-values : date.timezone='UTC'
48
44
coverage : pcov
49
45
tools : composer:v2
50
46
51
- - name : Determine composer cache directory (Linux/MacOS)
52
- if : matrix.os != 'windows-latest'
53
- run : echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
54
-
55
- - name : Determine composer cache directory (Windows)
56
- if : matrix.os == 'windows-latest'
57
- run : echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
58
-
59
- - name : Cache dependencies installed with composer
60
- uses : actions/cache@v2
61
- with :
62
- path : ${{ env.COMPOSER_CACHE_DIR }}
63
- key : php${{ matrix.php }}-os${{ matrix.os }}-yaml${{ matrix.yaml }}-composer-${{ hashFiles('**/composer.json') }}
64
-
65
-
66
- - name : Validate composer.json and composer.lock
67
- run : composer validate --ansi
68
-
69
- - name : Install dependencies (Linux/MacOS)
70
- if : matrix.os != 'windows-latest'
47
+ - name : Require specific symfony/yaml version
71
48
run : |
72
- make install
73
- composer require symfony/yaml:"${YAML}" --prefer-dist --no-interaction --ansi
49
+ composer require symfony/yaml:"${SYMFONY_YAML}" --prefer-dist --no-interaction --ansi --no-install
74
50
75
- - name : Install dependencies (Windows)
76
- if : matrix.os == 'windows-latest'
77
- run : |
78
- composer install --prefer-dist --no-interaction --no-progress --ansi
79
- composer require symfony/yaml:5.1.8 --prefer-dist --no-interaction --ansi
51
+ - name : " Install dependencies with Composer"
52
+ uses : " ramsey/composer-install@v2"
53
+ with :
54
+ dependency-versions : " ${{ matrix.dependencies }}"
80
55
81
56
- name : Validate test data
82
- if : matrix.os == 'ubuntu-latest'
83
57
run : make lint
84
58
85
- - name : PHP Stan analysis
86
- if : matrix.os == 'ubuntu-latest'
87
- run : make stan
88
-
89
- - name : PHPUnit tests (Linux/MacOS)
90
- if : matrix.os != 'windows-latest'
59
+ - name : PHPUnit tests
91
60
run : make test
92
61
93
- - name : PHPUnit tests (Windows)
94
- if : matrix.os == 'windows-latest'
95
- run : vendor/bin/phpunit --colors=always
96
-
97
- - name : Check code style
98
- if : matrix.os == 'ubuntu-latest'
99
- run : make check-style
100
-
101
62
- name : Code coverage
102
- if : matrix.os == 'ubuntu-latest'
103
63
run : make coverage
0 commit comments