1- name : PHP Composer
1+ name : Tests
22
33on :
44 push :
77 branches : [ master ]
88
99jobs :
10- build :
11-
10+ phpunit :
11+ name : Tests
12+ runs-on : ubuntu-latest
1213 strategy :
1314 fail-fast : false
1415 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']
2126 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
2528 - 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'
3433
35-
36- runs-on : ${{ matrix.os }}
3734 env :
38- YAML : ${{ matrix.yaml }}
35+ SYMFONY_YAML : ${{ matrix.symfony- yaml }}
3936
4037 steps :
4138 - uses : actions/checkout@v2
@@ -44,60 +41,23 @@ jobs:
4441 uses : shivammathur/setup-php@v2
4542 with :
4643 php-version : ${{ matrix.php }}
47- ini-values : date.timezone='UTC'
4844 coverage : pcov
4945 tools : composer:v2
5046
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
7148 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
7450
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 }}"
8055
8156 - name : Validate test data
82- if : matrix.os == 'ubuntu-latest'
8357 run : make lint
8458
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
9160 run : make test
9261
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-
10162 - name : Code coverage
102- if : matrix.os == 'ubuntu-latest'
10363 run : make coverage
0 commit comments