Skip to content

Commit

Permalink
Merge pull request #290 from woocommerce/dev/wc-wp-matrix
Browse files Browse the repository at this point in the history
Fetch WC & WP Matrix
  • Loading branch information
puntope authored Aug 17, 2023
2 parents 10c87e7 + 8f3aee8 commit b2742c4
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,39 @@ concurrency:
cancel-in-progress: true

jobs:
UnitTests:
name: PHP unit tests - PHP ${{ matrix.php }}, WP ${{ matrix.wp-version }}, WC ${{ matrix.wc-versions }}
GetMatrix:
name: Get WP and WC version Matrix
runs-on: ubuntu-latest
outputs:
wp-versions: ${{ steps.wp.outputs.versions }}
wc-versions: ${{ steps.wc.outputs.versions }}
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 || 'latest' }}, WC ${{ matrix.wc-versions || 'latest' }}
runs-on: ubuntu-latest
needs: GetMatrix
strategy:
matrix:
php: [7.4]
wp-version: [latest]
# Please note that wc-versions is a string contains versions separated by commas.
# Please note that wc-versions is a string containing versions separated by commas.
# It will be split and loop within the run unit test step below to reduce the time spent.
wc-versions: ["7.1.0, 7.2.0, latest"] # From L-2 to latest.
wc-versions: [ '${{ join(fromJson(needs.GetMatrix.outputs.wc-versions)) }}' ]
include:
# Minimum PHP support and L-2 WP/WC version
- php: 7.4
wp-version: 5.9
wc-versions: 7.1.0
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

steps:
- name: Checkout repository
Expand Down

0 comments on commit b2742c4

Please sign in to comment.