-
Notifications
You must be signed in to change notification settings - Fork 31
/
.travis.yml
67 lines (55 loc) · 3.7 KB
/
.travis.yml
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
osx_image: xcode12.2
language: swift
env:
global:
- LC_CTYPE=en_US.UTF-8
- WORKSPACE=L10n.xcworkspace
- IOS="iOS"
- MACOS="macOS"
- TVOS="tvOS"
- WATCHOS="watchOS"
matrix:
# iOS
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="YES" DESTINATION="OS=10.3.1,name=iPad Air"
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=13.5,name=iPad Pro (12.9-inch) (4th generation)"
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=11.4,name=iPhone 7"
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="YES" DESTINATION="OS=12.2,name=iPhone X"
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=13.4,name=iPhone 8 Plus"
- PLATFORM="$IOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="YES" DESTINATION="OS=14.1,name=iPhone 12 mini"
# watchOS
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=3.2,name=Apple Watch - 38mm"
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=4.1,name=Apple Watch Series 2 - 42mm"
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=5.2,name=Apple Watch Series 3 - 42mm"
# iOS + watchOS
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="NO" BUILD_EXAMPLE="NO" DESTINATION="OS=10.2,name=iPhone 6s Plus"
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="NO" BUILD_EXAMPLE="NO" DESTINATION="OS=11.3,name=iPhone 7 Plus"
- PLATFORM="$WATCHOS" RUN_TESTS="NO" BUILD_FRAMEWORK="NO" BUILD_EXAMPLE="NO" DESTINATION="OS=12.1,name=iPhone 8"
# tvOS
- PLATFORM="$TVOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=10.2,name=Apple TV"
- PLATFORM="$TVOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=12.4,name=Apple TV 4K"
- PLATFORM="$TVOS" RUN_TESTS="NO" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="OS=14.2,name=Apple TV 4K (at 1080p)"
# macOS
- PLATFORM="$MACOS" RUN_TESTS="YES" BUILD_FRAMEWORK="YES" BUILD_EXAMPLE="NO" DESTINATION="arch=x86_64"
script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks
- FRAMEWORK_SCHEME="L10n $PLATFORM";
- EXAMPLE_SCHEME="Example $PLATFORM";
# Build Framework
- if [ $BUILD_FRAMEWORK == "YES" ]; then
xcodebuild -project "L10n_swift.xcodeproj" -scheme "$FRAMEWORK_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
xcodebuild -project "L10n_swift.xcodeproj" -scheme "$FRAMEWORK_SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi
# Run Tests
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -project "L10n_swift.xcodeproj" -scheme "$FRAMEWORK_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
xcodebuild -project "L10n_swift.xcodeproj" -scheme "$FRAMEWORK_SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
fi
# Build Example
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -project "Example/Example.xcodeproj" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
xcodebuild -project "Example/Example.xcodeproj" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi
after_success:
- bash <(curl -s https://codecov.io/bash)