-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
executable file
·49 lines (47 loc) · 1.62 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
language: swift
osx_image: xcode11.1
os: osx
branches:
only:
- /.*/
cache:
directories:
- Carthage
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- PROJECT=Insights.xcodeproj
- IOS_FRAMEWORK_SCHEME="Insights"
matrix:
- ios_version='13.1' ios_device='iPhone 11' scheme="$IOS_FRAMEWORK_SCHEME" platform='iOS Simulator'
before_install:
# Boot the emulator by ID
- |
ios_uid=$(xcrun instruments -s devices | grep Simulator | grep "$ios_device ($ios_version)*" | grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}")
xcrun simctl boot $ios_uid
# List all emulator available
- xcrun simctl list
# Update the brew and build dependencies tools
- brew outdated carthage || brew upgrade carthage
- carthage bootstrap --verbose --no-use-binaries --platform iOS --cache-builds
- gem i slather
# Force to update the Swiftlint to the last stable version
- brew outdated swiftlint || brew upgrade swiftlint
# Print the booted emulator
- xcrun simctl list | grep "(Booted)"
# Print the swiftlint version
- swiftlint version
script: |
set -o pipefail
set -e
# Define the destination emulator
destination="platform=$platform,OS=$ios_version,name=$ios_device"
# Build and test Framework in Debug
xcodebuild -enableCodeCoverage YES clean build test -project "$PROJECT" \
-scheme "$scheme" \
-destination "$destination" \
-configuration Debug ONLY_ACTIVE_ARCH=YES ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
# Lint - Add `--strict` to fail for warning and violation
swiftlint lint --reporter json
after_success: slather