Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch WC L-1 versions #2046

Merged
merged 11 commits into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,46 @@ concurrency:

jobs:
GetMatrix:
name: Get WP version Matrix
name: Get WP and WC version Matrix
runs-on: ubuntu-latest
outputs:
wp-versions: ${{ steps.wp.outputs.versions }}
latest-wp-version: ${{ fromJson(steps.wp.outputs.versions)[0] }}
wc-versions: ${{ steps.wc.outputs.versions }}
latest-wc-version: ${{ fromJson(steps.wc.outputs.versions)[0] }}
steps:
- name: Get Release versions from Wordpress
id: wp
uses: woocommerce/grow/get-plugin-releases@actions-v1
with:
slug: wordpress
- name: Get Release versions from WooCommerce
id: wc
uses: woocommerce/grow/get-plugin-releases@actions-v1
with:
slug: woocommerce

UnitTests:
name: PHP unit tests - PHP ${{ matrix.php }}, WP ${{ matrix.wp-version }}
name: PHP unit tests - PHP ${{ matrix.php }}, WP ${{ matrix.wp-version || 'latest' }}, WC ${{ matrix.wc-versions || 'latest' }}
needs: GetMatrix
runs-on: ubuntu-latest
env:
WP_CORE_DIR: "/tmp/wordpress/src"
WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit"
strategy:
matrix:
php: [8.0]
wp-version: ${{ fromJson(needs.GetMatrix.outputs.wp-versions) }}
php: [ 8.0 ]
wp-version: [ latest ]
wc-versions: ${{ fromJson(needs.GetMatrix.outputs.wc-versions) }}
include:
- php: 8.2
wp-version: latest
wc-versions: latest
- php: 7.4
wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }}
wp-version: ${{ fromJson(needs.GetMatrix.outputs.wp-versions)[2] }} # L-2 WP Version support
wc-versions: ${{ fromJson(needs.GetMatrix.outputs.wc-versions)[2] }} # L-2 WC Version support
- php: 8.1
wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }}
- php: 8.2
wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }}
wp-version: latest
wc-versions: latest

steps:
- name: Checkout repository
Expand All @@ -67,9 +77,9 @@ jobs:
uses: woocommerce/grow/prepare-mysql@actions-v1

- name: Install WP tests
run: ./bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp-version }}
run: ./bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp-version }} ${{ matrix.wc-versions }}

- if: matrix.wp-version == needs.GetMatrix.outputs.latest-wp-version && matrix.php == 8.0
- if: matrix.wc-versions == needs.GetMatrix.outputs.latest-wc-version && matrix.php == 8.0
name: Set condition to generate coverage report (only on latest versions)
run: echo "generate_coverage=true" >> $GITHUB_ENV

Expand Down
Loading