Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope pull request workflows to paths #1079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ jobs:
with:
node-version: 20
cache: 'npm'
- name: Get changed files
id: changed-tests
uses: tj-actions/changed-files@v45
with:
files: |
packages/**/*.js
packages/**/*.scss
dist/app/components/**/*.html
- name: Install dependencies
if: steps.changed-tests.outputs.any_changed == 'true'
run: npm ci
- name: Run tests
if: steps.changed-tests.outputs.any_changed == 'true'
run: npm test

ui_tests:
Expand All @@ -60,9 +70,17 @@ jobs:
with:
node-version: 20
cache: 'npm'
- name: Get changed files
id: changed-ui_tests
uses: tj-actions/changed-files@v45
with:
files: |
packages/**
tests/**
app/**
- name: Install dependencies
if: steps.changed-ui_tests.outputs.any_changed == 'true'
run: npm ci
- name: Run tests
run: npm test
Comment on lines -65 to -66
Copy link
Contributor Author

@paulrobertlloyd paulrobertlloyd Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankieroberto Removed the (mostly) duplicate test run here, though potentially given concurrent tests, you’d want this workflow to fail early if there’s a failing test before running expensive visual regression tests?

- name: Run backstop
if: steps.changed-ui_tests.outputs.any_changed == 'true'
run: npm run backstop:ci