Skip to content

Commit 7ceeb70

Browse files
committed
ci: update PHP versions and GitHub Actions workflow configurations
1 parent 731ecda commit 7ceeb70

File tree

3 files changed

+25
-28
lines changed

3 files changed

+25
-28
lines changed

.github/workflows/cs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install PHP
2727
uses: shivammathur/setup-php@v2
2828
with:
29-
php-version: '7.4'
29+
php-version: '8.0'
3030
tools: cs2pr
3131
coverage: none
3232

@@ -50,4 +50,4 @@ jobs:
5050
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
5151

5252
- name: Show PHPCS results in PR
53-
run: cs2pr --graceful-warnings ./phpcs-report.xml
53+
run: cs2pr --graceful-warnings ./phpcs-report.xml

.github/workflows/unit-tests.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
matrix:
2424
# Notes regarding supported versions in WP:
2525
# The base matrix only contains the PHP versions which are supported on all supported WP versions.
26-
php: ['8.0', '7.3', '7.4']
26+
php: ['8.0', '8.1', '7.4']
2727
wp: ['latest']
2828
experimental: [false]
2929

@@ -37,8 +37,8 @@ jobs:
3737
- php: '8.2'
3838
wp: 'latest'
3939
experimental: true
40-
- php: '8.1'
41-
wp: 'latest'
40+
- php: '8.2'
41+
wp: '6.3'
4242
experimental: true
4343
- php: '8.0'
4444
wp: '5.9'
@@ -71,23 +71,18 @@ jobs:
7171
uses: shivammathur/setup-php@v2
7272
with:
7373
php-version: ${{ matrix.php }}
74-
tools: phpunit-polyfills
74+
extensions: mysqli, mysql
7575
coverage: none
76-
# The PHP 5.6 and 7.0 images don't include mysql[i] by default.
77-
extensions: mysqli
78-
79-
- name: Set up WordPress
80-
run: phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}
8176

8277
# On WP 5.2, PHPUnit 5.x, 6.x and 7.x are supported.
8378
# On PHP >= 8.0, PHPUnit 7.5+ is needed, no matter what.
8479
- name: Determine supported PHPUnit version
8580
id: set_phpunit
8681
run: |
87-
if [[ "${{ matrix.php }}" > "7.4" ]]; then
88-
echo "PHPUNIT=8.5.*" >> $GITHUB_ENV
82+
if [[ "${{ matrix.php }}" > "8.0" ]]; then
83+
echo "PHPUNIT=9.*" >> $GITHUB_ENV
8984
else
90-
echo "PHPUNIT=5.7.*||6.*||7.5.*" >> $GITHUB_ENV
85+
echo "PHPUNIT=5.7.*||6.*||7.5.*||8.5.*" >> $GITHUB_ENV
9186
fi
9287
9388
- name: 'Composer: set up PHPUnit'
@@ -99,30 +94,32 @@ jobs:
9994
# @link https://github.com/marketplace/actions/install-composer-dependencies
10095
- name: Install Composer dependencies for PHP < 8.0
10196
if: ${{ matrix.php < 8.0 }}
102-
uses: "ramsey/composer-install@v3"
97+
uses: "ramsey/composer-install@v2"
10398

10499
# For the PHP 8.0 and above, we need to install with ignore platform reqs as not all dependencies allow it yet.
105100
- name: Install Composer dependencies for PHP >= 8.0
106101
if: ${{ matrix.php >= 8.0 }}
107-
uses: "ramsey/composer-install@v3"
102+
uses: "ramsey/composer-install@v2"
108103
with:
109104
composer-options: --ignore-platform-reqs
110105

111-
- name: 'Run Composer Update'
112-
run: |
113-
composer update --ignore-platform-reqs
106+
- name: Install Subversion
107+
run: sudo apt-get install subversion
108+
109+
- name: Set up WordPress
110+
run: phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}
114111

115112
- name: Tool versions
116113
run: |
117114
php --version
118115
composer --version
119-
phpunit --version
120-
which phpunit
116+
./vendor/bin/phpunit --version
117+
which ./vendor/bin/phpunit
121118
122119
- name: Run the unit tests - single site
123-
run: vendor/bin/phpunit
120+
run: ./vendor/bin/phpunit
124121

125122
- name: Run the unit tests - multisite
126-
run: vendor/bin/phpunit
127123
env:
128124
WP_MULTISITE: 1
125+
run: ./vendor/bin/phpunit

.github/workflows/zipitup.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
- name: Create artifact
3030
uses: montudor/action-zip@v1
3131
with:
32-
args: zip -X -r build/knowledgebase.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml composer.* dev-helpers** build** wporg-assets** phpunit**
32+
args: zip -X -r build/${{ github.event.repository.name }}.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml *.neon composer.* package.json dev-helpers** build** wporg-assets** phpunit**
3333
- name: Upload artifact
3434
uses: actions/upload-artifact@v4
3535
with:
36-
name: knowledgebase
37-
path: build/knowledgebase.zip
36+
name: ${{ github.event.repository.name }}
37+
path: build/${{ github.event.repository.name }}.zip
3838
- name: Upload to release
3939
uses: JasonEtco/upload-to-release@master
4040
with:
41-
args: build/knowledgebase.zip application/zip
41+
args: build/${{ github.event.repository.name }}.zip application/zip
4242
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)