Skip to content

Commit

Permalink
Merge branch 'jrm/artifacts' into 'master'
Browse files Browse the repository at this point in the history
chore(ci): dump android logs in case of failure

See merge request TankerHQ/sdk-react-native!76
  • Loading branch information
Jeremy T committed Mar 1, 2022
2 parents 6138f54 + 040089b commit 59f4b28
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ stages:
- poetry run python -m pip install --upgrade pip
- poetry install

.artifacts:
artifacts:
when: always
paths: [logcat.txt]

########
# Jobs #
########
Expand All @@ -66,6 +71,7 @@ check/android/deployed:
stage: check
extends:
- .rules/check/deployed
- .artifacts
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py patch-sdk-version android $SDK_ANDROID_RELEASE_VERSION
Expand All @@ -77,6 +83,7 @@ check/android/downstream:
extends:
- .before-script/download-artifacts
- .rules/check/downstream/android
- .artifacts
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py build-and-test android
Expand All @@ -86,6 +93,7 @@ check/android/from-sources:
stage: check
extends:
- .rules/mr/manual
- .artifacts
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py prepare android --isolate-conan-user-home --use-tanker=deployed --tanker-ref=$SDK_NATIVE_LATEST_CONAN_REFERENCE
Expand All @@ -96,6 +104,7 @@ check/android/all-from-sources:
stage: check
extends:
- .rules/native-from-sources
- .artifacts
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py prepare android --isolate-conan-user-home --use-tanker=same-as-branch
Expand Down
26 changes: 17 additions & 9 deletions run-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,23 @@ def build_and_test_android() -> None:
cwd=Path.cwd() / "adminserver",
wait_for_process=5,
killpg=False,
), tankerci.android.emulator(small_size=False):
tankerci.run(
"yarn",
"detox",
"test",
"--configuration",
"android-ci",
cwd=example,
)
), tankerci.android.emulator(
small_size=False
):
try:
tankerci.run(
"yarn",
"detox",
"test",
"--configuration",
"android-ci",
cwd=example,
)
except: # noqa
dump_path = str(Path.cwd() / "logcat.txt")
tankerci.android.dump_logcat(dump_path)
ui.info("Tests have failed, logcat dumped to", dump_path)
raise


def build_and_test_ios() -> None:
Expand Down

0 comments on commit 59f4b28

Please sign in to comment.