From de2a08357fb60616f124e32b2fb328b5cc5d1f3f Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Mon, 9 Dec 2024 04:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Chore:=20Add=20Test=20Buil?= =?UTF-8?q?d=20Scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- scripts/test-builds-quick.sh | 66 +++++++++++++++++++++++++++++++ scripts/test-builds.sh | 76 ++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 scripts/test-builds-quick.sh create mode 100644 scripts/test-builds.sh diff --git a/package.json b/package.json index cf5baa1..b34a73e 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,9 @@ "update-dep:pods": "cd example/ios ; pod install --repo-update ; pod update DGSwiftUtilities ; cd ../.. ; yarn run build:update-version", "initialize": "yarn run initialize:js ; yarn run pod-install", "initialize:js": "yarn install ; cd example ; yarn install ; cd ..", - "initialize:reset": "npm run nuke:all ; yarn ; npm run initialize" + "initialize:reset": "npm run nuke:all ; yarn ; npm run initialize", + "test-build:all": "sh ./scripts/test-builds.sh", + "test-build:all-quick": "sh ./scripts/test-builds-quick.sh" }, "keywords": [ "react-native", diff --git a/scripts/test-builds-quick.sh b/scripts/test-builds-quick.sh new file mode 100644 index 0000000..4b0b214 --- /dev/null +++ b/scripts/test-builds-quick.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +NEW_ARCH_STATIC=PENDING +OLD_ARCH_STATIC=PENDING +NEW_ARCH_DYNAMIC=PENDING +OLD_ARCH_DYNAMIC=PENDING + +log_build_status() { + echo "\n\n\nBUILD RESULTS..."; + echo "Build - NEW_ARCH_STATIC: ${NEW_ARCH_STATIC}" + echo "Build - OLD_ARCH_STATIC: ${OLD_ARCH_STATIC}" + echo "Build - NEW_ARCH_DYNAMIC: ${NEW_ARCH_DYNAMIC}" + echo "Build - OLD_ARCH_DYNAMIC: ${OLD_ARCH_DYNAMIC}" + echo "\n\n" +} + +log_build_status; + +echo '\n\nBuild - new-arch (fabric) + static: Begin...\n' +yarn run pod-install:new-static +yarn run build:ios ; + +if [ $? -eq 0 ]; then + NEW_ARCH_STATIC=SUCCESS; +else + NEW_ARCH_STATIC=FAILED; +fi; + +log_build_status + +echo '\n\nBuild - old-arch (paper) + static: Begin...' +yarn run pod-install:old-static +yarn run build:ios ; + +if [ $? -eq 0 ]; then + OLD_ARCH_STATIC=SUCCESS; +else + OLD_ARCH_STATIC=FAILED; +fi; + +log_build_status + +echo '\nBuild - new-arch (fabric) + dynamic: Begin...\n' +yarn run pod-install:new-dynamic +yarn run build:ios ; + +if [ $? -eq 0 ]; then + NEW_ARCH_DYNAMIC=SUCCESS; +else + NEW_ARCH_DYNAMIC=FAILED; +fi; + +log_build_status; + +echo 'Build - old-arch (paper) + static: Begin...' +yarn run pod-install:old-dynamic +yarn run build:ios ; + +if [ $? -eq 0 ]; then + OLD_ARCH_DYNAMIC=SUCCESS; +else + OLD_ARCH_DYNAMIC=FAILED; +fi; + +echo "\n\n All Builds Completed..." +log_build_status \ No newline at end of file diff --git a/scripts/test-builds.sh b/scripts/test-builds.sh new file mode 100644 index 0000000..1668722 --- /dev/null +++ b/scripts/test-builds.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +NEW_ARCH_STATIC=PENDING +OLD_ARCH_STATIC=PENDING +NEW_ARCH_DYNAMIC=PENDING +OLD_ARCH_DYNAMIC=PENDING + +log_build_status() { + echo "\n\n\nBUILD RESULTS..."; + echo "Build - NEW_ARCH_STATIC: ${NEW_ARCH_STATIC}" + echo "Build - OLD_ARCH_STATIC: ${OLD_ARCH_STATIC}" + echo "Build - NEW_ARCH_DYNAMIC: ${NEW_ARCH_DYNAMIC}" + echo "Build - OLD_ARCH_DYNAMIC: ${OLD_ARCH_DYNAMIC}" + echo "\n\n" +} + +clear_cache(){ + echo '\nclearing pods + derived data...' + yarn run nuke:example-pods + yarn run nuke:derived-data +} + +log_build_status; +clear_cache; + +echo '\n\nBuild - new-arch (fabric) + static: Begin...\n' +yarn run pod-install:new-static +yarn run build:ios ; + +if [ $? -eq 0 ]; then + NEW_ARCH_STATIC=SUCCESS; +else + NEW_ARCH_STATIC=FAILED; +fi; + +log_build_status +clear_cache + +echo '\n\nBuild - old-arch (paper) + static: Begin...' +yarn run pod-install:old-static +yarn run build:ios ; + +if [ $? -eq 0 ]; then + OLD_ARCH_STATIC=SUCCESS; +else + OLD_ARCH_STATIC=FAILED; +fi; + +log_build_status +clear_cache + +echo '\nBuild - new-arch (fabric) + dynamic: Begin...\n' +yarn run pod-install:new-dynamic +yarn run build:ios ; + +if [ $? -eq 0 ]; then + NEW_ARCH_DYNAMIC=SUCCESS; +else + NEW_ARCH_DYNAMIC=FAILED; +fi; + +log_build_status; +clear_cache; + +echo 'Build - old-arch (paper) + static: Begin...' +yarn run pod-install:old-dynamic +yarn run build:ios ; + +if [ $? -eq 0 ]; then + OLD_ARCH_DYNAMIC=SUCCESS; +else + OLD_ARCH_DYNAMIC=FAILED; +fi; + +echo "\n\n All Builds Completed..." +log_build_status; \ No newline at end of file