chore(repo): skip detox and react native e2e if not touched (#10951)

This commit is contained in:
Miroslav Jonaš 2022-06-30 19:15:42 +02:00 committed by GitHub
parent 6d8ed4baba
commit aa2934674e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,10 +214,25 @@ jobs:
os: macos
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Check if "detox" or "react-native" were modified directly
command: |
COUNT=`git diff --name-only $NX_BASE $NX_HEAD | (grep -E 'packages/detox|packages/react-native|e2e/detox|e2e/react-native' || true) | wc -l`
if [[ $COUNT -gt 0 ]]; then
echo "React Native and Detox were touched directly"
echo "export E2E_AFFECTED=true;" >> $BASH_ENV
else
echo "React Native and Detox were not touched directly"
echo "export E2E_AFFECTED=false;" >> $BASH_ENV
fi
- run:
name: Run E2E Tests
command: |
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-nx-run,e2e-nx-misc,e2e-react,e2e-web,e2e-angular-extensions,e2e-angular-core,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e,e2e-nx-init,e2e-dep-graph-client --parallel=1
if $E2E_AFFECTED; then
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-nx-run,e2e-nx-misc,e2e-react,e2e-web,e2e-angular-extensions,e2e-angular-core,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e,e2e-nx-init,e2e-dep-graph-client --parallel=1;
else
echo "Skipping E2E tests";
fi
no_output_timeout: 45m
- run:
name: Stop All Running Agents for This CI Run