chore(repo): skip detox and react native e2e if not touched (#10951)
This commit is contained in:
parent
6d8ed4baba
commit
aa2934674e
@ -214,10 +214,25 @@ jobs:
|
|||||||
os: macos
|
os: macos
|
||||||
- nx/set-shas:
|
- nx/set-shas:
|
||||||
main-branch-name: 'master'
|
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:
|
- run:
|
||||||
name: Run E2E Tests
|
name: Run E2E Tests
|
||||||
command: |
|
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
|
no_output_timeout: 45m
|
||||||
- run:
|
- run:
|
||||||
name: Stop All Running Agents for This CI Run
|
name: Stop All Running Agents for This CI Run
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user