Skip to content

Commit f96c2ee

Browse files
authored
GH Actions: various tweaks / PHP 8.2 not allowed to fail (#285)
* GH Actions: use PHP `latest` ... for those tasks where the PHP version isn't (or shouldn't be) that relevant. Includes updating the task name to not include the PHP version (`latest` will roll on automatically). * GH Actions: minor simplification ... of the bash `date` command in the earlier pulled cache busting. * GH Actions: update PHP versions in workflows PHP 8.2 has been released today 🎉 and the `setup-php` action has announced support for PHP 8.3, so adding PHP 8.3 to the matrix and no longer allowing PHP 8.2 to fail the build. Note: PHPCS does not (yet) have full syntax support for PHP 8.2, but it does have runtime support (for the most part, see squizlabs/PHP_CodeSniffer 3629). Builds against PHP 8.3 are still allowed to fail for now. Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
1 parent e619b63 commit f96c2ee

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

.github/workflows/csqa.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818

1919
jobs:
2020
checkcs:
21-
name: 'PHP: 7.4 | Basic CS and QA checks'
21+
name: 'Basic CS and QA checks'
2222
runs-on: ubuntu-latest
2323

2424
env:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: '7.4'
34+
php-version: 'latest'
3535
coverage: none
3636
tools: cs2pr
3737

@@ -44,8 +44,8 @@ jobs:
4444
- name: Install Composer dependencies
4545
uses: "ramsey/composer-install@v2"
4646
with:
47-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
48-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
47+
# Bust the cache at least once a month - output format: YYYY-MM.
48+
custom-cache-suffix: $(date -u "+%Y-%m")
4949

5050
- name: Install xmllint
5151
run: |
@@ -75,7 +75,7 @@ jobs:
7575
run: cs2pr ./phpcs-report.xml
7676

7777
static-analysis:
78-
name: "PHP: 7.4 | Static Analysis"
78+
name: "PHPStan & Psalm"
7979
runs-on: ubuntu-latest
8080

8181
steps:
@@ -85,7 +85,7 @@ jobs:
8585
- name: Install PHP
8686
uses: shivammathur/setup-php@v2
8787
with:
88-
php-version: '7.4'
88+
php-version: 'latest'
8989
coverage: none
9090

9191
# Install dependencies and handle caching in one go.
@@ -94,8 +94,8 @@ jobs:
9494
- name: Install Composer dependencies
9595
uses: "ramsey/composer-install@v2"
9696
with:
97-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
98-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
97+
# Bust the cache at least once a month - output format: YYYY-MM.
98+
custom-cache-suffix: $(date -u "+%Y-%m")
9999

100100
- name: Run Static Analysis
101101
run: composer static-analysis

.github/workflows/test.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ jobs:
2929
# - PHPCS will run without errors on PHP 5.4 - 7.4 on all supported PHPCS versions.
3030
# - PHP 8.0 needs PHPCS 3.5.7+ to run without errors.
3131
# - PHP 8.1 needs PHPCS 3.6.1+ to run without errors.
32+
# - PHP 8.2 needs PHPCS 3.6.1+ to run without errors.
3233
#
3334
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
3435
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3']
3536
phpcs_version: ['3.5.6', 'dev-master']
3637

3738
include:
3839
# Make the matrix complete without duplicating builds run in code coverage.
40+
- php: '8.2'
41+
phpcs_version: '3.6.1'
42+
43+
- php: '8.1'
44+
phpcs_version: 'dev-master'
3945
- php: '8.1'
4046
phpcs_version: '3.6.1'
4147

@@ -48,12 +54,12 @@ jobs:
4854
phpcs_version: 'dev-master'
4955

5056
# Experimental builds.
51-
- php: '8.2' # Nightly.
57+
- php: '8.3' # Nightly.
5258
phpcs_version: 'dev-master'
5359

5460
name: "Test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}"
5561

56-
continue-on-error: ${{ matrix.php == '8.2' }}
62+
continue-on-error: ${{ matrix.php == '8.3' }}
5763

5864
steps:
5965
- name: Checkout code
@@ -87,19 +93,19 @@ jobs:
8793
# Install dependencies and handle caching in one go.
8894
# @link https://github.com/marketplace/actions/install-composer-dependencies
8995
- name: Install Composer dependencies - normal
90-
if: ${{ matrix.php != '8.2' }}
96+
if: ${{ matrix.php != '8.3' }}
9197
uses: "ramsey/composer-install@v2"
9298
with:
93-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
94-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
99+
# Bust the cache at least once a month - output format: YYYY-MM.
100+
custom-cache-suffix: $(date -u "+%Y-%m")
95101

96102
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies allow it yet.
97103
- name: Install Composer dependencies - with ignore platform
98-
if: ${{ matrix.php == '8.2' }}
104+
if: ${{ matrix.php == '8.3' }}
99105
uses: "ramsey/composer-install@v2"
100106
with:
101107
composer-options: --ignore-platform-req=php
102-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
108+
custom-cache-suffix: $(date -u "+%Y-%m")
103109

104110
- name: Run the unit tests
105111
run: composer test
@@ -115,7 +121,7 @@ jobs:
115121
strategy:
116122
matrix:
117123
include:
118-
- php: '8.1'
124+
- php: '8.2'
119125
phpcs_version: 'dev-master'
120126
- php: '7.4'
121127
phpcs_version: '3.5.6'
@@ -158,8 +164,8 @@ jobs:
158164
- name: Install Composer dependencies
159165
uses: "ramsey/composer-install@v2"
160166
with:
161-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
162-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
167+
# Bust the cache at least once a month - output format: YYYY-MM.
168+
custom-cache-suffix: $(date -u "+%Y-%m")
163169

164170
- name: Grab PHPUnit version
165171
id: phpunit_version

0 commit comments

Comments
 (0)