From 9216ed341ff330189ef3280d90cf16f5b4782746 Mon Sep 17 00:00:00 2001 From: Arooran Thanabalasingam <13069024+bigaru@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:35:08 +0100 Subject: [PATCH] ci: add matrix testing --- .github/workflows/test-e2e-matrix.yml | 39 +++++++++++++++++++++++++++ .github/workflows/test-e2e.yml | 19 ++++++++++--- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-e2e-matrix.yml diff --git a/.github/workflows/test-e2e-matrix.yml b/.github/workflows/test-e2e-matrix.yml new file mode 100644 index 00000000..c0de0d0c --- /dev/null +++ b/.github/workflows/test-e2e-matrix.yml @@ -0,0 +1,39 @@ +name: E2E Tests + +on: + pull_request: + +jobs: + e2e_tests: + name: > + E2E - ${{ + format( + 'WP{0} + PHP{1}', + matrix.wp, + matrix.php + ) + }} + uses: ./.github/workflows/test-e2e.yml + strategy: + fail-fast: false + matrix: + wp: # Test against Prev-Prev Major, Prev-Major, and current Major release versions. + - '6.5' + - '6.6' + - '6.7' + php: # Test against minimum and latest PHP versions. + - '7.4' + - '8.3' + with: + wpVersion: ${{matrix.wp}} + phpVersion: ${{matrix.php}} + concurrency: + group: > + ${{ + format( + 'e2e-WP{0}-PHP{1}', + matrix.wp, + matrix.php + ) + }} + cancel-in-progress: true diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index b4195cff..9634e248 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -1,4 +1,4 @@ -name: 'E2E Tests' +name: E2E Tests on: workflow_dispatch: @@ -14,15 +14,26 @@ on: type: string default: '8.2' - pull_request: + workflow_call: + inputs: + wpVersion: + description: 'Enter WP version (eg 6.6)' + required: false + type: string + default: '' + phpVersion: + description: 'Enter PHP version (eg 8.2)' + required: false + type: string + default: '8.2' jobs: test: runs-on: ubuntu-latest env: # trenary ${{ condition && if-value || else-value }} - INSERI_WP_CORE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.wpVersion != '' && format('WordPress/WordPress#{0}', github.event.inputs.wpVersion) || '' }} - INSERI_WP_PHP: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.phpVersion || '8.2' }} + INSERI_WP_CORE: ${{ inputs.wpVersion != '' && format('WordPress/WordPress#{0}', inputs.wpVersion) || '' }} + INSERI_WP_PHP: ${{ inputs.phpVersion }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4