@@ -47,33 +47,22 @@ aliases:
4747 set -u
4848 set -o pipefail
4949
50- # This Shallow Git Clone code is adapted from what the standard CircleCI `checkout` command does for the case of an external PR (link to example below):
51- # https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/49817/workflows/dc195ea6-ac06-4de1-9edf-4c949427b5fb/jobs/1430976/parallel-runs/0/steps/0-101
52- ### git clone --no-checkout "$CIRCLE_REPOSITORY_URL" .
53- ### git fetch --force origin +refs/pull/18748/head:refs/remotes/origin/pull/18748
54- ### git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
55- ### git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
56-
5750 # Set up SSH access
5851 # This SSH key is the current github.com SSH key as of June 2023, but it will need to be changed whenever github changes their key (probably every few years)
5952 GITHUB_SSH_KEY="AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl"
6053 mkdir -p ~/.ssh
6154 echo github.com ssh-ed25519 $GITHUB_SSH_KEY >> ~/.ssh/known_hosts
6255
63- # Take a different clone path depending on if it's a tag, a PR from an external repo, or the normal case
56+ git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
57+ git fetch --depth 1 origin "$CIRCLE_SHA1"
58+
6459 if [ -n "${CIRCLE_TAG-}" ]; then
65- # tag
66- git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
67- git fetch --depth 1 --force origin "+refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
68- git checkout --force -q "$CIRCLE_TAG" "$CIRCLE_SHA1"
69- elif [[ "$CIRCLE_BRANCH" =~ ^pull\/* ]]; then
70- # pull request
71- git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
72- git fetch --depth 1 --force origin "${CIRCLE_BRANCH}/head:remotes/origin/${CIRCLE_BRANCH}"
73- git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
60+ echo "Checkout tag '${CIRCLE_TAG}' at commit '${CIRCLE_SHA1}'"
61+ git checkout "$CIRCLE_TAG"
62+ git reset --hard "$CIRCLE_SHA1"
7463 else
75- # normal case
76- git clone --depth 1 "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
64+ echo "Checkout branch '${CIRCLE_BRANCH}' at commit '${CIRCLE_SHA1}'"
65+ git checkout -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
7766 fi
7867
7968workflows :
@@ -880,7 +869,7 @@ jobs:
880869 command : |
881870 if .circleci/scripts/test-run-e2e.sh
882871 then
883- yarn test:e2e:chrome --retries 2 --debug
872+ timeout 20m yarn test:e2e:chrome --retries 2 --debug
884873 fi
885874 no_output_timeout : 5m
886875 - store_artifacts :
@@ -907,9 +896,11 @@ jobs:
907896 command : |
908897 if .circleci/scripts/test-run-e2e.sh
909898 then
910- MULTICHAIN=1 yarn test:e2e:chrome --retries 2 --debug
899+ timeout 20m yarn test:e2e:chrome --retries 2 --debug
911900 fi
912901 no_output_timeout : 5m
902+ environment :
903+ MULTICHAIN : 1
913904 - store_artifacts :
914905 path : test-artifacts
915906 destination : test-artifacts
@@ -934,7 +925,7 @@ jobs:
934925 command : |
935926 if .circleci/scripts/test-run-e2e.sh
936927 then
937- yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
928+ timeout 20m yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
938929 fi
939930 no_output_timeout : 5m
940931 - store_artifacts :
@@ -959,7 +950,7 @@ jobs:
959950 command : |
960951 if .circleci/scripts/test-run-e2e.sh
961952 then
962- yarn test:e2e:chrome:rpc --retries 2
953+ timeout 20m yarn test:e2e:chrome:rpc --retries 2
963954 fi
964955 no_output_timeout : 5m
965956 - store_artifacts :
@@ -1012,7 +1003,7 @@ jobs:
10121003 command : |
10131004 if .circleci/scripts/test-run-e2e.sh
10141005 then
1015- yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
1006+ timeout 20m yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
10161007 fi
10171008 no_output_timeout : 5m
10181009 - store_artifacts :
@@ -1054,7 +1045,7 @@ jobs:
10541045 command : |
10551046 if .circleci/scripts/test-run-e2e.sh
10561047 then
1057- yarn test:e2e:firefox:flask --retries 2 --debug
1048+ timeout 20m yarn test:e2e:firefox:flask --retries 2 --debug
10581049 fi
10591050 no_output_timeout : 5m
10601051 - store_artifacts :
@@ -1081,7 +1072,7 @@ jobs:
10811072 command : |
10821073 if .circleci/scripts/test-run-e2e.sh
10831074 then
1084- yarn test:e2e:chrome:flask --retries 2 --debug
1075+ timeout 20m yarn test:e2e:chrome:flask --retries 2 --debug
10851076 fi
10861077 no_output_timeout : 5m
10871078 - store_artifacts :
@@ -1108,7 +1099,7 @@ jobs:
11081099 command : |
11091100 if .circleci/scripts/test-run-e2e.sh
11101101 then
1111- yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
1102+ timeout 20m yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
11121103 fi
11131104 no_output_timeout : 5m
11141105 - store_artifacts :
@@ -1136,7 +1127,7 @@ jobs:
11361127 command : |
11371128 TESTFILES=$(circleci tests glob "test/e2e/mmi/**/*.spec.ts")
11381129 echo "$TESTFILES"
1139- echo "$TESTFILES" | circleci tests run --command="xvfb-run xargs yarn playwright test" verbose --split-by=timings
1130+ echo "$TESTFILES" | timeout 20m circleci tests run --command="xvfb-run xargs yarn playwright test" verbose --split-by=timings
11401131 no_output_timeout : 10m
11411132 - slack/notify :
11421133 branch_pattern : Version-v*
@@ -1175,7 +1166,7 @@ jobs:
11751166 command : |
11761167 if .circleci/scripts/test-run-e2e.sh
11771168 then
1178- yarn test:e2e:firefox --retries 2 --debug
1169+ timeout 20m yarn test:e2e:firefox --retries 2 --debug
11791170 fi
11801171 no_output_timeout : 5m
11811172 - store_artifacts :
0 commit comments