forked from Instagram/IGListKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
136 lines (112 loc) · 5.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
language: objective-c
osx_image: xcode10.2
gemfile: Gemfile
addons:
homebrew:
packages:
- swiftlint
update: true
branches:
only:
- master
- stable
- travis-stages
cache:
- cocoapods
- bundler
- $HOME/Library/Caches/Homebrew
env:
global:
- LANG=en_US.UTF-8
- IOS_SCHEME="IGListKit"
- IOS_SDK=iphonesimulator12.2
- MACOS_SDK=macosx10.14
- TVOS_SDK=appletvsimulator12.2
- IOS_EXAMPLE_WORKSPACE="Examples/Examples-iOS/IGListKitExamples.xcworkspace"
- TVOS_EXAMPLE_WORKSPACE="Examples/Examples-tvOS/IGListKitExamples.xcworkspace"
- MACOS_EXAMPLE_WORKSPACE="Examples/Examples-macOS/IGListKitExamples.xcworkspace"
- EXAMPLE_SCHEME="IGListKitExamples"
# iOS Destinations
- IOS_DESTINATION_9="OS=9.3,name=iPad Air 2"
- IOS_DESTINATION_10="OS=10.3.1,name=iPhone 7"
- IOS_DESTINATION_11="OS=11.3,name=iPhone X"
- IOS_DESTINATION_12="OS=12.2,name=iPhone Xʀ"
# macOS Destinations
- MACOS_DESTINATION="arch=x86_64"
# tvOS Destinations
- TVOS_DESTINATION_10="OS=10.2,name=Apple TV 1080p"
- TVOS_DESTINATION_11="OS=11.3,name=Apple TV 4K"
- TVOS_DESTINATION_12="OS=12.2,name=Apple TV 4K"
before_install:
# Bundler 2.0
- gem update --system
- gem install bundler
jobs:
include:
- stage: pod lint
name: Cocoapods Lint
# We need to pass all of the podspecs here so that Cocoapods uses the local version,
# rather than searching the specs repository for the other specs in the repo.
script:
- bundle exec pod lib lint IGListDiffKit.podspec --allow-warnings
- bundle exec pod lib lint IGListKit.podspec --allow-warnings "--include-podspecs=IGListDiffKit.podspec"
- bundle exec pod lib lint IGListSwiftKit.podspec --allow-warnings "--include-podspecs=*.podspec"
# Build example projects
- &build-examples
stage: build examples
name: "iOS 12.2"
env: DESTINATION="$IOS_DESTINATION_12" WORKSPACE="$IOS_EXAMPLE_WORKSPACE" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
script:
- set -o pipefail
- xcodebuild -version -sdk
- xcodebuild build -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | bundle exec xcpretty -c;
- <<: *build-examples
name: "iOS 11.3"
env: DESTINATION="$IOS_DESTINATION_11" WORKSPACE="$IOS_EXAMPLE_WORKSPACE" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
- <<: *build-examples
name: "iOS 10.3.1"
env: DESTINATION="$IOS_DESTINATION_10" WORKSPACE="$IOS_EXAMPLE_WORKSPACE" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
- <<: *build-examples
name: "iOS 9.3"
env: DESTINATION="$IOS_DESTINATION_9" WORKSPACE="$IOS_EXAMPLE_WORKSPACE" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
- <<: *build-examples
name: "macOS 10.13"
env: DESTINATION="$MACOS_DESTINATION" WORKSPACE="$MACOS_EXAMPLE_WORKSPACE" SDK="$MACOS_SDK" SCHEME="$EXAMPLE_SCHEME"
- <<: *build-examples
name: "tvOS 12.3"
env: DESTINATION="$TVOS_DESTINATION_12" WORKSPACE="$TVOS_EXAMPLE_WORKSPACE" SDK="$TVOS_SDK" SCHEME="$EXAMPLE_SCHEME"
- <<: *build-examples
name: "tvOS 11.3"
env: DESTINATION="$TVOS_DESTINATION_11" WORKSPACE="$TVOS_EXAMPLE_WORKSPACE" SDK="$TVOS_SDK" SCHEME="$EXAMPLE_SCHEME"
- <<: *build-examples
name: "tvOS 10.3"
env: DESTINATION="$TVOS_DESTINATION_10" WORKSPACE="$TVOS_EXAMPLE_WORKSPACE" SDK="$TVOS_SDK" SCHEME="$EXAMPLE_SCHEME"
# UI Tests
- stage: tests
name: "UI Tests: iOS 12.2"
env: DESTINATION="$IOS_DESTINATION_12" WORKSPACE="$IOS_EXAMPLE_WORKSPACE" SDK="$IOS_SDK" SCHEME="$EXAMPLE_SCHEME"
script:
- set -o pipefail
- xcodebuild build test -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | bundle exec xcpretty -c;
# Unit Tests
- &unit-tests
stage: tests
name: "Tests: iOS 12.2"
env: DESTINATION="$IOS_DESTINATION_12" WORKSPACE="IGListKit.xcworkspace" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
script:
- set -o pipefail
- xcodebuild build build-for-testing -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c;
- xcodebuild analyze test-without-building -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c;
after_success:
- bundle exec slather
- <<: *unit-tests
name: "Tests: iOS 11.3"
env: DESTINATION="$IOS_DESTINATION_11" WORKSPACE="IGListKit.xcworkspace" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
# Danger
- stage: Danger
script: bundle exec danger --verbose
stages:
- pod lint
- build examples
- tests
- danger