Skip to content

Commit e7b677b

Browse files
setup(workflow): CI run test only on changed workspace(s)
1 parent 3f2c982 commit e7b677b

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ jobs:
6262

6363
lint-and-types:
6464
name: Lint & types
65+
runs-on: ubuntu-slim
6566

6667
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
6768

68-
runs-on: ubuntu-slim
69-
7069
steps:
7170
# FIXME https://github.com/step-security/harden-runner/issues/627
7271
# - name: Harden the runner (Audit all outbound calls)
@@ -85,11 +84,10 @@ jobs:
8584

8685
test:
8786
name: Codemod JSSG tests
87+
runs-on: ${{ matrix.os }}
8888

8989
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
9090

91-
runs-on: ${{ matrix.os }}
92-
9391
strategy:
9492
fail-fast: false
9593
matrix:
@@ -117,4 +115,12 @@ jobs:
117115
node-version-file: ".nvmrc"
118116

119117
- run: npm ci
120-
- run: node --run test
118+
119+
- run: >
120+
npm run test $(
121+
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
122+
| grep '^recipes/'
123+
| cut -d/ -f1,2
124+
| sort -u
125+
| sed 's/^/--workspace=/'
126+
)

0 commit comments

Comments
 (0)