Skip to content

Commit

Permalink
don't run tests if no updates
Browse files Browse the repository at this point in the history
  • Loading branch information
olerichter00 committed Mar 21, 2024
1 parent fe65bbc commit 63f7de6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/ci/ci-test-js-pr
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ UPDATED_FILES=$(git diff --name-only origin/main...$CIRCLE_SHA1 | grep -E '^.+\.
JEST_OPTIONS="--ci --forceExit --logHeapUsage --runInBand --reporters=default --reporters=jest-junit --shard=$(expr $CIRCLE_NODE_INDEX + 1)/$CIRCLE_NODE_TOTAL"


# Run all tests if any global files are updated because they could affect any test.
# If no ts|tsx files are updated, don't run any tests
# If only scene files are updated, run tests only for those scenes and specific files.
if [ -z "$UPDATED_GLOBAL_FILES" ]
# Run all tests if any global files are updated because they could affect any test.
if [ -z "$UPDATED_GLOBAL_FILES" ] && [ -n "$UPDATED_SCENES" ] && [ -n "$UPDATED_FILES" ]
then
yarn jest $UPDATED_SCENES $UPDATED_FILES $JEST_OPTIONS
else
yarn jest $JEST_OPTIONS
elif [ -z "$UPDATED_GLOBAL_FILES" ]
echo "No ts|tsx files are updated. Skipping tests."
then
yarn jest $JEST_OPTIONS
fi

0 comments on commit 63f7de6

Please sign in to comment.