Skip to content

Commit 707e819

Browse files
jacekradkoNicolasLopes7
authored andcommitted
chore(repo): Improve change detection in CI (#7040)
1 parent 586ad21 commit 707e819

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

.changeset/slick-files-stick.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ jobs:
277277
strategy:
278278
fail-fast: false
279279
matrix:
280-
test-name:
281-
[
280+
test-name: [
282281
'generic',
283282
'express',
284283
'quickstart',
@@ -325,6 +324,15 @@ jobs:
325324
turbo-token: ${{ secrets.TURBO_TOKEN }}
326325
playwright-enabled: true
327326

327+
- name: Verify jq is installed
328+
shell: bash
329+
run: |
330+
if ! command -v jq &> /dev/null; then
331+
echo "jq not found, installing..."
332+
sudo apt-get update && sudo apt-get install -y jq
333+
fi
334+
jq --version
335+
328336
- name: Task Status
329337
id: task-status
330338
env:
@@ -334,8 +342,16 @@ jobs:
334342
E2E_PROJECT: ${{ matrix.test-project }}
335343
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
336344
run: |
337-
AFFECTED=0
338-
(pnpm turbo-ignore --task=test:integration:${{ matrix.test-name }} --fallback=${{ github.base_ref || 'refs/heads/main' }}) || AFFECTED=1
345+
# Use turbo's built-in --affected flag to detect changes
346+
# This automatically uses GITHUB_BASE_REF in GitHub Actions
347+
TASK_COUNT=$(pnpm turbo run test:integration:${{ matrix.test-name }} --affected --dry=json 2>/dev/null | jq '.tasks | length' 2>/dev/null || echo "0")
348+
349+
if [ "$TASK_COUNT" -gt 0 ]; then
350+
AFFECTED=1
351+
else
352+
AFFECTED=0
353+
fi
354+
339355
echo "affected=${AFFECTED}"
340356
echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT
341357

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
"ts-jest": "29.2.5",
141141
"tsup": "catalog:repo",
142142
"turbo": "^2.5.4",
143-
"turbo-ignore": "^2.5.4",
144143
"typedoc": "0.28.5",
145144
"typedoc-plugin-markdown": "4.6.4",
146145
"typedoc-plugin-replace-text": "4.2.0",

pnpm-lock.yaml

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)