64
64
#
65
65
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
66
66
php : ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
67
- phpcs_version : ["4.x-dev"]
67
+ phpcs_version : ["lowest", "stable", "4.x-dev"]
68
+
69
+ exclude :
70
+ - php : " 8.3"
71
+ phpcs_version : " lowest"
72
+
73
+ include :
74
+ # Add some builds with variations of the dependency versions.
75
+ - php : " 8.4"
76
+ phpcs_version : " stable"
77
+
78
+ # Test against dev versions of all dependencies with select PHP versions for early detection of issues.
79
+ - php : " 7.2"
80
+ phpcs_version : " dev-master"
81
+ - php : " 7.2"
82
+ phpcs_version : " 4.x-dev"
83
+ - php : " 7.4"
84
+ phpcs_version : " 4.x-dev"
85
+ - php : " 8.2"
86
+ phpcs_version : " 4.x-dev"
68
87
69
88
name : " Test: PHP ${{ matrix.php }}"
70
89
@@ -90,6 +109,14 @@ jobs:
90
109
ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
91
110
coverage : none
92
111
112
+ - name : " Composer: set PHPCS version for tests (dev)"
113
+ if : ${{ contains( matrix.phpcs_version, 'dev') }}
114
+ run : composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction
115
+
116
+ - name : " Composer: use lock file when necessary"
117
+ if : ${{ matrix.phpcs_version == 'lowest' }}
118
+ run : composer config --unset lock
119
+
93
120
# Install dependencies and handle caching in one go.
94
121
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
95
122
- name : Install Composer dependencies
@@ -98,6 +125,10 @@ jobs:
98
125
# Bust the cache at least once a month - output format: YYYY-MM.
99
126
custom-cache-suffix : $(date -u "+%Y-%m")
100
127
128
+ - name : " Composer: set PHPCS version for tests (lowest)"
129
+ if : ${{ matrix.phpcs_version == 'lowest' }}
130
+ run : composer update squizlabs/php_codesniffer --prefer-lowest --no-scripts --no-interaction
131
+
101
132
- name : Composer info
102
133
run : composer info
103
134
0 commit comments