feat(Cookies): Updates WP Cookie Expiration to Same as Session Length… #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Triggers the workflow on push events only for the matching branches | |
push: | |
branches: | |
- 'release/**' | |
env: | |
COMPOSER_VERSION: '2.6' | |
ACTION_VERSION: 3 | |
jobs: | |
matrix_unit_testing: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.bleeding-edge }} | |
strategy: | |
fail-fast: false | |
matrix: | |
job-name: ['Unit Test'] | |
php-version: ['7.4','8.0'] | |
wordpress-version: ['5.7.*','5.8.*','5.9.*'] | |
wp-multisite-mode: [0] | |
bleeding-edge: [false] | |
include: | |
- job-name: 'Unit Test Bleeding Edge Requirements' | |
bleeding-edge: true | |
php-version: '8.1' | |
wordpress-version: 'dev-master' | |
wp-multisite-mode: 0 | |
- job-name: 'Unit Test Multisite Compatibility Requirements' | |
bleeding-edge: false | |
php-version: '8.0' | |
wordpress-version: '5.9.*' | |
wp-multisite-mode: 1 | |
name: '${{ matrix.job-name }} (PHP:${{ matrix.php-version }}/WP:${{ matrix.wordpress-version }})' | |
steps: | |
- name: Checkout Code | |
# https://github.com/marketplace/actions/checkout | |
uses: actions/checkout@v2 | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
if: ${{ !env.ACT }} | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache Composer dependencies | |
if: ${{ !env.ACT }} | |
uses: actions/cache@v2 | |
env: | |
composer-cache-name: cache-composer | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-v${{ env.ACTION_VERSION }}- | |
- name: Setup Node Environment | |
# https://github.com/marketplace/actions/setup-node-js-environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: Setup PHP & Composer Environment | |
# https://github.com/marketplace/actions/setup-php-action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
tools: "composer:${{ env.COMPOSER_VERSION }}" | |
- name: Environment Check | |
run: php -v && composer --version | |
- name: Require Specified WordPress Version (PHP <7.4) | |
if: matrix.php-version == '7.3' || matrix.php-version == '7.2' | |
run: composer require johnpbloch/wordpress-core:${{ matrix.wordpress-version }} php-stubs/wordpress-stubs:${{ matrix.wordpress-version }} wp-phpunit/wp-phpunit:${{ matrix.wordpress-version }} --dev --prefer-source --update-with-all-dependencies --ignore-platform-req=php | |
- name: Require Specified WordPress Version (Bleeding Edge) | |
if: matrix.bleeding-edge | |
run: composer require johnpbloch/wordpress-core:${{ matrix.wordpress-version }} php-stubs/wordpress-stubs:${{ matrix.wordpress-version }} szepeviktor/phpstan-wordpress:* wp-phpunit/wp-phpunit:${{ matrix.wordpress-version }} --dev --prefer-source --update-with-all-dependencies | |
- name: Require Specified WordPress Version | |
if: matrix.php-version != '7.3' && matrix.php-version != '7.2' && ! matrix.bleeding-edge | |
run: composer require johnpbloch/wordpress-core:${{ matrix.wordpress-version }} php-stubs/wordpress-stubs:${{ matrix.wordpress-version }} wp-phpunit/wp-phpunit:${{ matrix.wordpress-version }} --dev --prefer-source --update-with-all-dependencies | |
- name: PHPUnit Bleeding Edge Support | |
if: matrix.bleeding-edge | |
run: | | |
composer require sebastian/code-unit:dev-main phpunit/phpunit:dev-master phpro/grumphp:dev-master --dev -W --ignore-platform-req=php --update-with-all-dependencies | |
- name: PHPUnit PHP 8.0 Support | |
if: matrix.php-version == '8.0' | |
run: | | |
composer require phpunit/phpunit:^8.0 phpro/grumphp:^1.10.0 --dev -W --ignore-platform-req=php | |
- name: Install Composer Dependencies (PHP 8.x) | |
if: matrix.php-version == '8.0' || matrix.php-version == '8.1' | |
run: composer install --prefer-dist --ignore-platform-req=php | |
- name: Install Composer Dependencies | |
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' | |
run: composer install --prefer-dist | |
- name: NPM Setup | |
run: npm ci | |
- name: Unit Tests | |
env: | |
WP_MULTISITE: ${{ matrix.wp-multisite-mode }} | |
run: npm run test |