This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
fix: Updates dependencies & local development environment #136
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
name: PR Unit Testing | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Triggers the workflow on pull request events | |
pull_request: | |
env: | |
ACTION_VERSION: 4 | |
PHP_VERSION: '8.1' | |
COMPOSER_VERSION: '2.5' | |
WP_VERSION: '6.5.*' | |
WP_MULTISITE: 0 | |
WC_VERSION: '8.7.*' | |
jobs: | |
pr_unit_testing: | |
runs-on: ubuntu-latest | |
name: 'Unit Test PR in Latest Stable Requirements' | |
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-${{ env.WP_VERSION }}-wc-${{ env.WC_VERSION }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ env.WP_VERSION }}-wc-${{ env.WC_VERSION }}-v${{ env.ACTION_VERSION }}- | |
- name: Setup PHP & Composer Environment | |
# https://github.com/marketplace/actions/setup-php-action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ env.PHP_VERSION }}" | |
tools: "composer:${{ env.COMPOSER_VERSION }}" | |
- name: Environment Check | |
run: php -v && composer --version | |
- name: Require Specified WordPress & WooCommerce Version | |
run: composer require johnpbloch/wordpress-core:${{ env.WP_VERSION }} php-stubs/wordpress-stubs:${{ env.WP_VERSION }} wp-phpunit/wp-phpunit:${{ env.WP_VERSION }} wpackagist-plugin/woocommerce:${{ env.WC_VERSION }} php-stubs/woocommerce-stubs:${{ env.WC_VERSION }} --dev --prefer-source --update-with-all-dependencies | |
- name: Install Composer Dependencies | |
run: composer install --prefer-dist | |
- name: Unit Tests | |
run: composer test |