@@ -2,15 +2,13 @@ name: Lint & Test
22on :
33 schedule :
44 - cron : " 0 0 * * *"
5- push :
6- branches :
7- - ' **'
5+ pull_request :
86jobs :
97 lint :
108 name : Lint
119 runs-on : ubuntu-latest
1210 steps :
13- - uses : actions/checkout@v3
11+ - uses : actions/checkout@v5
1412 - name : Install Composer dependencies
1513 run : composer install --no-interaction --prefer-dist
1614 - name : Run PHP Lint
@@ -19,22 +17,22 @@ jobs:
1917 name : WP.org Plugin Validation
2018 runs-on : ubuntu-latest
2119 steps :
22- - uses : pantheon-systems/action-wporg-validator@1 .0.0
20+ - uses : pantheon-systems/action-wporg-validator@v2 .0.0
2321 with :
2422 type : ' plugin'
2523 validate-readme-spacing :
2624 name : Validate README Spacing
2725 runs-on : ubuntu-latest
2826 steps :
2927 - name : Checkout
30- uses : actions/checkout@v3
28+ uses : actions/checkout@v5
3129 - uses : pantheon-systems/validate-readme-spacing@v1
3230 php8-compatibility :
3331 name : PHP 8.x Compatibility
3432 runs-on : ubuntu-latest
3533 steps :
3634 - name : Checkout
37- uses : actions/checkout@v3
35+ uses : actions/checkout@v5
3836 - name : PHP Compatibility
3937 uses : pantheon-systems/phpcompatibility-action@dev
4038 with :
4846 image : mariadb:10.5
4947 name : PHP 7.4 Unit Tests
5048 steps :
51- - uses : actions/checkout@v3
49+ - uses : actions/checkout@v5
5250 - name : Setup PHP 7.4
5351 uses : shivammathur/setup-php@v2
5452 with :
@@ -57,43 +55,76 @@ jobs:
5755 - name : Start MySQL Service
5856 run : sudo systemctl start mysql
5957 - name : Cache dependencies
60- uses : actions/cache@v3
58+ uses : actions/cache@v4
6159 with :
6260 path : ~/vendor
6361 key : test-phpunit-dependencies-${{ hashFiles('composer.json') }}
6462 restore-keys : test-phpunit-dependencies-${{ hashFiles('composer.json') }}
63+ - name : Setup WP-CLI
64+ uses : godaddy-wordpress/setup-wp-cli@1
6565 - name : Install Composer dependencies
6666 run : |
67- composer update && composer install
67+ composer require pantheon-systems/pantheon-wp-coding-standards:^2.0 --dev --no-update
68+ composer update
69+ composer install
70+ chmod +x bin/*.sh
6871 - name : Run PHP linting
6972 run : composer phplint
73+ - name : Reset MariaDB root password to empty
74+ run : |
75+ until mysqladmin ping -h127.0.0.1 -uroot -proot --silent; do
76+ sleep 1
77+ done
78+ mysql -h127.0.0.1 -uroot -proot <<'SQL'
79+ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
80+ FLUSH PRIVILEGES;
81+ SQL
82+ mysqladmin ping -h127.0.0.1 -uroot --silent
83+ - name : Install WPUnit tests
84+ run : composer test:install:withdb
7085 - name : Run PHPUnit
71- run : bash ./bin/ phpunit-test.sh
72- test-phpunit-83 :
86+ run : composer phpunit
87+ test-phpunit-84 :
7388 needs : lint
7489 runs-on : ubuntu-latest
7590 services :
7691 mariadb :
7792 image : mariadb:10.6
78- name : PHP 8.3 Unit Tests
93+ name : PHP 8.4 Unit Tests
7994 steps :
80- - uses : actions/checkout@v3
81- - name : Setup PHP 8.3
95+ - uses : actions/checkout@v5
96+ - name : Setup PHP 8.4
8297 uses : shivammathur/setup-php@v2
8398 with :
84- php-version : 8.3
99+ php-version : 8.4
85100 extensions : mysqli, zip, imagick
86101 - name : Start MySQL Service
87102 run : sudo systemctl start mysql
88103 - name : Cache dependencies
89- uses : actions/cache@v3
104+ uses : actions/cache@v4
90105 with :
91106 path : ~/vendor
92107 key : test-phpunit-dependencies-${{ hashFiles('composer.json') }}
93108 restore-keys : test-phpunit-dependencies-${{ hashFiles('composer.json') }}
109+ - name : Setup WP-CLI
110+ uses : godaddy-wordpress/setup-wp-cli@1
94111 - name : Install Composer dependencies
95- run : composer install
112+ run : |
113+ composer install
114+ chmod +x bin/*.sh
96115 - name : Run PHP linting
97116 run : composer phplint
117+ - name : Reset MariaDB root password to empty
118+ run : |
119+ until mysqladmin ping -h127.0.0.1 -uroot -proot --silent; do
120+ sleep 1
121+ done
122+ mysql -h127.0.0.1 -uroot -proot <<'SQL'
123+ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
124+ FLUSH PRIVILEGES;
125+ SQL
126+ mysqladmin ping -h127.0.0.1 -uroot --silent
127+ - name : Install WPUnit tests
128+ run : composer test:install:withdb
98129 - name : Run PHPUnit
99- run : bash ./bin/ phpunit-test.sh
130+ run : composer phpunit
0 commit comments