Skip to content

Commit f7339d3

Browse files
authored
Merge pull request tsparticles#5632 from tsparticles/v4
workflow update
2 parents 248bb1f + c60b81c commit f7339d3

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555
run: |
5656
if [ -z "$NX_CLOUD_ACCESS_TOKEN" ]; then
5757
echo "NX Cloud token missing — using local nx execution"
58-
echo "NX_CLOUD_DISTRIBUTED_EXECUTION=false" >> $GITHUB_ENV
58+
echo "NX_NO_CLOUD=true" >> $GITHUB_ENV
59+
echo "NX_CLOUD_STARTED=false" >> $GITHUB_ENV
5960
exit 0
6061
fi
6162
@@ -67,10 +68,21 @@ jobs:
6768
nx_cloud_started=false
6869
6970
until [ "$retries" -ge "$max_retries" ]; do
70-
if npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js"; then
71+
output=$(npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" 2>&1)
72+
exit_code=$?
73+
74+
if echo "$output" | grep -q "401\|sufficient access\|unauthorized\|Unauthorized"; then
75+
echo "NX Cloud auth failed (401) — falling back to local nx immediately"
76+
echo "NX_NO_CLOUD=true" >> $GITHUB_ENV
77+
echo "NX_CLOUD_STARTED=false" >> $GITHUB_ENV
78+
exit 0
79+
fi
80+
81+
if [ "$exit_code" -eq 0 ]; then
7182
nx_cloud_started=true
7283
break
7384
fi
85+
7486
echo "nx-cloud start failed (attempt $((retries + 1))/${max_retries}). Retrying in $((2 ** retries))s..."
7587
sleep $((2 ** retries))
7688
retries=$((retries + 1))
@@ -81,7 +93,7 @@ jobs:
8193
echo "NX_CLOUD_STARTED=true" >> $GITHUB_ENV
8294
else
8395
echo "nx-cloud start failed after ${max_retries} attempts — falling back to local nx"
84-
echo "NX_CLOUD_DISTRIBUTED_EXECUTION=false" >> $GITHUB_ENV
96+
echo "NX_NO_CLOUD=true" >> $GITHUB_ENV
8597
echo "NX_CLOUD_STARTED=false" >> $GITHUB_ENV
8698
fi
8799
@@ -91,9 +103,6 @@ jobs:
91103
- name: Build packages
92104
run: npx nx affected -t build:ci
93105

94-
- name: Run unit tests (test:ci)
95-
run: pnpm --filter @tsparticles/tests run test:ci
96-
97106
- name: Deploy to Firebase (production)
98107
if: env.firebaseToken != '' && github.ref == 'refs/heads/main' && github.event_name == 'push'
99108
uses: FirebaseExtended/action-hosting-deploy@v0

0 commit comments

Comments
 (0)