Skip to content

Commit

Permalink
Use different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Mar 7, 2024
1 parent a814425 commit 8dd6110
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/blocks-playwright-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,24 @@ on:
config:
required: true
type: string
results-path:
results-folder:
required: true
type: string
shard-index:
required: true
type: array
type: number
shard-total:
required: true
type: number

jobs:
e2e:
name: ${{ inputs.name }} [${{ matrix.shard-index }}/${{ matrix.shard-total }}]
name: ${{ inputs.name }} [${{ inputs.shard-index }}/${{ inputs.shard-total }}]
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/woocommerce-blocks
strategy:
fail-fast: false
matrix:
shard-index: ${{ inputs.shard-index }}
shard-total: ${{ inputs.shard-total }}
steps:
- uses: actions/checkout@v3

Expand All @@ -49,11 +44,11 @@ jobs:

- name: Run Playwright tests
working-directory: plugins/woocommerce-blocks
run: pnpm playwright test --config=tests/e2e/${{ inputs.config }} --shard ${{ matrix.shard-index }}/${{ matrix.shard-total }}
run: pnpm playwright test --config=tests/e2e/${{ inputs.config }} --shard ${{ inputs.shard-index }}/${{ inputs.shard-total }}

- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: playwright-report-${{ inputs.config }}
path: plugins/woocommerce-blocks/tests/e2e/artifacts/test-results${{ inputs.config }}
name: playwright-report-${{ inputs.results-folder }}
path: plugins/woocommerce-blocks/tests/e2e/artifacts/${{ inputs.results-folder }}
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
47 changes: 35 additions & 12 deletions .github/workflows/blocks-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,57 @@ env:

jobs:
default-theme:
strategy:
fail-fast: false
matrix:
shard-index: [1, 2, 3, 4, 5]
shard-total: [5]
uses: ./.github/workflows/blocks-playwright-template.yml
with:
name: Default (Block) Theme
config: playwright.config.ts
result-path: test-results
shard-index: [1, 2, 3, 4, 5]
shard-total: 5
results-folder: test-results
shard-index: ${{ matrix.shard-index }}
shard-total: ${{ matrix.shard-total }}

classic-theme:
strategy:
fail-fast: false
matrix:
shard-index: [1, 2, 3, 4]
shard-total: [4]
uses: ./.github/workflows/blocks-playwright-template.yml
with:
name: Classic Theme
config: playwright.classic-theme.config.ts
result-path: test-results-classic-theme
shard-index: [1, 2, 3, 4]
shard-total: 4
results-folder: test-results-classic-theme
shard-index: ${{ matrix.shard-index }}
shard-total: ${{ matrix.shard-total }}

side-effects:
strategy:
fail-fast: false
matrix:
shard-index: [1, 2, 3, 4, 5]
shard-total: [5]
uses: ./.github/workflows/blocks-playwright-template.yml
with:
name: Side Effects
config: playwright.side-effects.config.ts
result-path: test-results-side-effects
shard-index: [1, 2, 3, 4, 5]
shard-total: 5
results-folder: test-results-side-effects
shard-index: ${{ matrix.shard-index }}
shard-total: ${{ matrix.shard-total }}

block-theme-with-templates:
strategy:
fail-fast: false
matrix:
shard-index: [1]
shard-total: [1]
uses: ./.github/workflows/blocks-playwright-template.yml
with:
name: Block Theme With Templates
config: playwright.block-theme-with-templates.config.ts
result-path: test-results-block-theme-with-templates
shard-index: [1]
shard-total: 1
results-folder: test-results-block-theme-with-templates
shard-index: ${{ matrix.shard-index }}
shard-total: ${{ matrix.shard-total }}

0 comments on commit 8dd6110

Please sign in to comment.