Skip to content

Commit

Permalink
ci: add matrix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bigaru committed Dec 5, 2024
1 parent c6d3881 commit 9216ed3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test-e2e-matrix.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 15 additions & 4 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'E2E Tests'
name: E2E Tests

on:
workflow_dispatch:
Expand All @@ -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
Expand Down

0 comments on commit 9216ed3

Please sign in to comment.