Skip to content

Commit

Permalink
Merge pull request #2215 from WordPress/feature/ghactions-test-changes
Browse files Browse the repository at this point in the history
GH Actions: various changes
  • Loading branch information
jrfnl committed Mar 27, 2023
2 parents f4d4ff5 + 957ee9e commit d742981
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/basic-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
strategy:
matrix:
php: [ 'latest' ]
phpcs_version: [ '3.7.1', 'dev-master' ]
phpcs_version: [ 'lowest', 'dev-master' ]

name: "Ruleset test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}"

Expand All @@ -114,15 +114,21 @@ jobs:
ini-values: error_reporting = E_ALL & ~E_DEPRECATED
coverage: none

- name: Set PHPCS version
- name: "Set PHPCS version (master)"
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: --no-dev
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Set PHPCS version (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction

- name: Test the WordPress-Core ruleset
run: $(pwd)/vendor/bin/phpcs -ps ./Tests/RulesetCheck/class-ruleset-test.inc --standard=WordPress-Core

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ jobs:
strategy:
matrix:
php: [ '5.4', 'latest' ]
phpcs_version: [ 'dev-master' ]
include:
- php: '7.3'
phpcs_version: '3.7.1'
- php: '5.4'
phpcs_version: '3.7.1'
phpcs_version: [ 'lowest', 'dev-master' ]

name: QTest - PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}

Expand All @@ -55,7 +50,8 @@ jobs:
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
coverage: none

- name: Set PHPCS version
- name: "Set PHPCS version (master)"
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Install Composer dependencies (PHP < 8.0 )
Expand All @@ -69,9 +65,13 @@ jobs:
if: ${{ matrix.php >= 8.0 || matrix.php == 'latest' }}
uses: ramsey/composer-install@v2
with:
composer-options: --ignore-platform-reqs
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Set PHPCS version (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction

- name: Lint PHP files against parse errors
if: ${{ matrix.phpcs_version == 'dev-master' }}
run: composer lint -- --checkstyle
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
phpcs_version: [ '3.7.1', 'dev-master' ]
phpcs_version: [ 'lowest', 'dev-master' ]
extensions: [ '' ]

include:
Expand Down Expand Up @@ -61,7 +61,8 @@ jobs:
coverage: none
tools: cs2pr

- name: Set PHPCS version
- name: "Set PHPCS version (master)"
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Install Composer dependencies (PHP < 8.0 )
Expand All @@ -75,9 +76,13 @@ jobs:
if: ${{ matrix.php >= 8.0 }}
uses: ramsey/composer-install@v2
with:
composer-options: --ignore-platform-reqs
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Set PHPCS version (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction

- name: Lint PHP files against parse errors
if: ${{ matrix.phpcs_version == 'dev-master' }}
run: composer lint -- --checkstyle | cs2pr
Expand Down

0 comments on commit d742981

Please sign in to comment.