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