Skip to content

Commit 77cfd99

Browse files
authored
Merge pull request #193 from PHPCSStandards/feature/ghactions-tweak-php-versions
GH Actions: various tweaks / PHP 8.2 not allowed to fail
2 parents cd79216 + b290f87 commit 77cfd99

File tree

5 files changed

+34
-15
lines changed

5 files changed

+34
-15
lines changed

.github/workflows/integrationtest.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- '8.0'
3535
- '8.1'
3636
- '8.2'
37+
- '8.3'
3738
composer:
3839
- 'v1'
3940
- 'v2'
@@ -70,6 +71,9 @@ jobs:
7071
- php: '8.2'
7172
composer: '2.2'
7273
os: 'ubuntu-latest'
74+
- php: '8.3'
75+
composer: '2.2'
76+
os: 'ubuntu-latest'
7377

7478
- php: '7.2'
7579
composer: '2.2'
@@ -89,6 +93,9 @@ jobs:
8993
- php: '8.2'
9094
composer: '2.2'
9195
os: 'windows-latest'
96+
- php: '8.3'
97+
composer: '2.2'
98+
os: 'windows-latest'
9299

93100
# Also test against the dev version of Composer for early warning about upcoming changes.
94101
- php: 'latest'
@@ -101,7 +108,7 @@ jobs:
101108

102109
name: "Integration test"
103110

104-
continue-on-error: ${{ matrix.php == '8.2' || matrix.composer == 'snapshot' }}
111+
continue-on-error: ${{ matrix.php == '8.3' || matrix.composer == 'snapshot' }}
105112

106113
steps:
107114
- name: Checkout code
@@ -123,19 +130,19 @@ jobs:
123130
# Install dependencies and handle caching in one go.
124131
# @link https://github.com/marketplace/actions/install-composer-dependencies
125132
- name: Install Composer dependencies
126-
if: ${{ matrix.php != '8.2' }}
133+
if: ${{ matrix.php != '8.3' }}
127134
uses: "ramsey/composer-install@v2"
128135
with:
129136
composer-options: '--optimize-autoloader'
130-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
131-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
137+
# Bust the cache at least once a month - output format: YYYY-MM.
138+
custom-cache-suffix: $(date -u "+%Y-%m")
132139

133140
- name: Install Composer dependencies
134-
if: ${{ matrix.php == '8.2' }}
141+
if: ${{ matrix.php == '8.3' }}
135142
uses: "ramsey/composer-install@v2"
136143
with:
137144
composer-options: '--ignore-platform-reqs --optimize-autoloader'
138-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
145+
custom-cache-suffix: $(date -u "+%Y-%m")
139146

140147
- name: Run integration tests
141148
run: vendor/bin/phpunit --no-coverage

.github/workflows/phplint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: Install Composer dependencies
4040
uses: "ramsey/composer-install@v2"
4141
with:
42-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
43-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
42+
# Bust the cache at least once a month - output format: YYYY-MM.
43+
custom-cache-suffix: $(date -u "+%Y-%m")
4444

4545
- name: Lint against parse errors
4646
run: composer lint -- --checkstyle | cs2pr

.github/workflows/quicktest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
uses: "ramsey/composer-install@v2"
6161
with:
6262
composer-options: '--optimize-autoloader'
63-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
64-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
63+
# Bust the cache at least once a month - output format: YYYY-MM.
64+
custom-cache-suffix: $(date -u "+%Y-%m")
6565

6666
- name: Run integration tests
6767
run: vendor/bin/phpunit --no-coverage

.github/workflows/securitycheck.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ jobs:
3737
- name: Install Composer dependencies
3838
uses: "ramsey/composer-install@v2"
3939
with:
40-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
41-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
40+
# Bust the cache at least once a month - output format: YYYY-MM.
41+
custom-cache-suffix: $(date -u "+%Y-%m")
4242

4343
- name: Download security checker
4444
# yamllint disable-line rule:line-length
45-
run: wget -P . https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.5/local-php-security-checker_2.0.5_linux_amd64
45+
run: wget -P . https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.6/local-php-security-checker_2.0.6_linux_amd64
4646

4747
- name: Make security checker executable
48-
run: chmod +x ./local-php-security-checker_2.0.5_linux_amd64
48+
run: chmod +x ./local-php-security-checker_2.0.6_linux_amd64
4949

5050
- name: Check against insecure dependencies
51-
run: ./local-php-security-checker_2.0.5_linux_amd64 --path=composer.lock
51+
run: ./local-php-security-checker_2.0.6_linux_amd64 --path=composer.lock

tests/PHPCSVersions.php

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ final class PHPCSVersions
8484
'3.6.0' => '3.6.0',
8585
'3.6.1' => '3.6.1',
8686
'3.6.2' => '3.6.2',
87+
'3.7.0' => '3.7.0',
88+
'3.7.1' => '3.7.1',
8789
);
8890

8991
/**
@@ -342,6 +344,16 @@ function ($version) {
342344
break;
343345

344346
case '8.2':
347+
$versions = array_filter(
348+
self::$allPhpcsVersions,
349+
function ($version) {
350+
// PHPCS 3.6.1 is the first PHPCS version with runtime support for PHP 8.2.
351+
return version_compare($version, '3.6.1', '>=');
352+
}
353+
);
354+
break;
355+
356+
case '8.3':
345357
/*
346358
* At this point in time, it is unclear as of which PHPCS version PHP 8.2 will be supported.
347359
* In other words: tests should only use dev-master/4.x when on PHP 8.2 for the time being.

0 commit comments

Comments
 (0)