From 2f9cfc53bcb7ee9d4a2f57c2e5990bf75c28e592 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Thu, 21 Nov 2024 17:50:26 +0000 Subject: [PATCH] Scope pull-request workflows to paths --- .github/workflows/pull-request.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7b1392220..47241e0f1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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: @@ -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 - name: Run backstop + if: steps.changed-ui_tests.outputs.any_changed == 'true' run: npm run backstop:ci