Skip to content

Commit cdf9fd0

Browse files
Update ci.yml
1 parent 890cac9 commit cdf9fd0

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- "utils/**/*.ts"
1414
- "utils/package.json"
1515
- "package.json"
16-
- "package-lock.json"
1716
- ".github/workflows/ci.yml"
1817
pull_request:
1918
branches: ["*"]
@@ -23,7 +22,6 @@ on:
2322
- "utils/**/*.ts"
2423
- "utils/**/package.json"
2524
- "package.json"
26-
- "package-lock.json"
2725
- ".github/workflows/ci.yml"
2826
types:
2927
- opened
@@ -113,10 +111,20 @@ jobs:
113111
- run: npm ci
114112

115113
- run: >
114+
changed_paths=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
115+
116+
# run everything?
117+
if echo "$changed_paths" | grep -qE '^(package\.json|\.github/workflows/ci\.yml)$'; then
118+
npm run test --workspaces
119+
exit 0
120+
fi
121+
122+
# run for specific workspace(s)
116123
npm run test $(
117-
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
118-
| grep '^recipes/'
119-
| cut -d/ -f1,2
124+
echo "$changed_paths" \
125+
| awk -F/ '
126+
/^packages\// { print "--workspace=" $1 "/" $2 }
127+
/^utils\// { print "--workspace=utils" }
128+
' \
120129
| sort -u
121-
| sed 's/^/--workspace=/'
122130
)

0 commit comments

Comments
 (0)