diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..c46f8d5c5d73108a696219f6217a31d2ff4b5a46 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +before_script: + - for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts + - for ip in $(dig @8.8.8.8 git.xx.network +short); do ssh-keyscan git.xx.network,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts + - swift --version + - xcodebuild -version + +stages: + - test + +test-package-macos: + stage: test + tags: + - ios + script: + - ./run-tests.sh macos + retry: 1 + +test-package-ios: + stage: test + tags: + - ios + script: + - ./run-tests.sh ios + retry: 1 diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..7bfc617118bea4b955a221a110a000711824a77b --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +if [ "$1" = "macos" ]; then + + echo "\n\033[1;32m▶ Running package tests on macOS...\033[0m" + set -o pipefail && swift test | ./xcbeautify + +elif [ "$1" = "ios" ]; then + + echo "\n\033[1;32m▶ Running package tests on iOS Simulator...\033[0m" + set -o pipefail && xcodebuild -scheme 'xx-client-ios-db-Package' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=16.0,name=iPhone 14' test | ./xcbeautify + +else + + echo "\n\033[1;31m▶ Invalid option.\033[0m Usage:" + echo " run-tests.sh macos - Run package tests on macOS" + echo " run-tests.sh ios - Run package tests on iOS Simulator" + exit 1 + +fi diff --git a/xcbeautify b/xcbeautify new file mode 100755 index 0000000000000000000000000000000000000000..76b5df583a5d8f479e2088d4927ad90288c9d4cd Binary files /dev/null and b/xcbeautify differ