Skip to content

Commit

Permalink
chore(func): Filter test runs based on file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
avattipalli committed Nov 5, 2024
1 parent f15fcae commit 56fb65d
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@ env:
BIGCOMMERCE_STORE_HASH: ${{ secrets.BIGCOMMERCE_STORE_HASH }}

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
required: ${{ steps.filter.outputs.file_path }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
file_path:
- 'core/**'
- 'packages/client/**'
- 'packages/create-catalyst/**'
generate-lighthouse-audit:
needs: changes
name: Lighthouse Audit
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}
if: ${{ needs.changes.outputs.file_path == 'true' && contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -104,10 +121,11 @@ jobs:
${{ steps.format_lighthouse_score_mobile.outputs.comment }}
ui-tests:
needs: changes
name: Playwright UI Tests
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}
if: ${{ needs.changes.outputs.file_path == 'true' && contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -166,10 +184,11 @@ jobs:
}
visual-regression-tests:
needs: changes
name: Playwright Visual Regression Tests
timeout-minutes: 30
runs-on: macos-14
if: ${{ contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}
if: ${{ needs.changes.outputs.file_path == 'true' && contains(fromJson('["Production – catalyst-latest", "Preview – catalyst-latest"]'), github.event.deployment_status.environment) }}

steps:
- name: Checkout code
Expand Down

0 comments on commit 56fb65d

Please sign in to comment.