forked from scinfu/SwiftSoup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci
executable file
·79 lines (69 loc) · 1.5 KB
/
ci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
# Determine OS
UNAME=`uname`;
if [[ $UNAME == "Darwin" ]];
then
OS="macos";
else
if [[ $UNAME == "Linux" ]];
then
UBUNTU_RELEASE=`lsb_release -a 2>/dev/null`;
if [[ $UBUNTU_RELEASE == *"16.04"* ]];
then
OS="ubuntu1604";
else
OS="ubuntu1404";
fi
else
echo "Unsupported Operating System: $UNAME";
fi
fi
echo "🖥 Operating System: $OS";
if [[ $OS != "macos" ]];
then
echo "🐦 Installing Swift";
eval "$(curl -sL https://apt.vapor.sh)";
sudo apt-get install vapor;
sudo chmod -R a+rx /usr/;
fi
echo "📅 Version: `swift --version`";
echo "🚀 Building";
swift build
if [[ $? != 0 ]];
then
echo "❌ Build failed";
exit 1;
fi
echo "💼 Building Release";
swift build -c release
if [[ $? != 0 ]];
then
echo "❌ Build for release failed";
exit 1;
fi
echo "🔎 Testing";
swift test
if [[ $? != 0 ]];
then
echo "❌ Tests failed";
exit 1;
fi
if [[ $OS == "macos" ]];
then
echo "Running on $OS - building on Xcode"
xcodebuild -project SwiftSoup.xcodeproj -scheme SwiftSoup-iOS -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 6' build test
if [[ $? != 0 ]];
then
echo "❌ Xcode Project Tests failed";
exit 1;
fi
sudo gem install cocoapods --pre
sudo gem cleanup
pod lib lint
if [[ $? != 0 ]];
then
echo "❌ Pod failed to lint";
exit 1;
fi
fi
echo "✅ Done"