Skip to content

Commit eb214da

Browse files
committed
Refactor CI configs and add SPM to CI
1 parent 25e3bfe commit eb214da

File tree

4 files changed

+61
-45
lines changed

4 files changed

+61
-45
lines changed

.travis.yml

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,36 @@
11
---
2-
language: objective-c
3-
4-
osx_image: xcode11.1
2+
os: osx
3+
osx_image: xcode11.3
4+
language: minimal
55

66
cache:
77
directories:
88
- Carthage
99

10-
env:
11-
global:
12-
- WORKSPACE=GEOSwiftMapKit.xcworkspace
13-
matrix:
14-
- PLATFORM=iOS
15-
SCHEME=GEOSwiftMapKit-iOS
16-
SDK=iphonesimulator13.1
17-
DESTINATION="platform=iOS Simulator,OS=13.1,name=iPhone 11"
18-
RUN_CODECOV=true
19-
- PLATFORM=tvOS
20-
SCHEME=GEOSwiftMapKit-tvOS
21-
SDK=appletvsimulator13.0
22-
DESTINATION="platform=tvOS Simulator,OS=13.0,name=Apple TV"
23-
RUN_CODECOV=false
24-
- PLATFORM=macOS
25-
SCHEME=GEOSwiftMapKit-macOS
26-
SDK=macosx10.15
27-
DESTINATION="platform=OS X"
28-
RUN_CODECOV=false
29-
30-
before_install:
31-
- brew install carthage swiftlint
32-
- gem install xcpretty
33-
- travis_wait 30 carthage update
34-
--cache-builds
35-
--platform "$PLATFORM"
36-
--no-use-binaries
37-
38-
script:
39-
- set -o pipefail
40-
- xcodebuild
41-
-workspace "$WORKSPACE"
42-
-scheme "$SCHEME"
43-
-sdk "$SDK"
44-
-destination "$DESTINATION"
45-
-configuration Debug
46-
ONLY_ACTIVE_ARCH=YES
47-
clean test | xcpretty -c;
10+
jobs:
11+
include:
12+
- name: iOS - xcodebuild
13+
env: PLATFORM=iOS
14+
SCHEME=GEOSwiftMapKit-iOS
15+
SDK=iphonesimulator13.2
16+
DESTINATION="platform=iOS Simulator,OS=13.3,name=iPhone 11"
17+
WORKSPACE=GEOSwiftMapKit.xcworkspace
18+
RUN_CODECOV=true
19+
- name: tvOS - xcodebuild
20+
env: PLATFORM=tvOS
21+
SCHEME=GEOSwiftMapKit-tvOS
22+
SDK=appletvsimulator13.2
23+
DESTINATION="platform=tvOS Simulator,OS=13.3,name=Apple TV"
24+
WORKSPACE=GEOSwiftMapKit.xcworkspace
25+
- name: macOS - xcodebuild
26+
env: PLATFORM=macOS
27+
SCHEME=GEOSwiftMapKit-macOS
28+
SDK=macosx10.15
29+
DESTINATION="platform=OS X"
30+
WORKSPACE=GEOSwiftMapKit.xcworkspace
31+
- name: macOS - SPM
32+
env: USE_SPM=true
4833

49-
after_success:
50-
- if [ "${RUN_CODECOV}" = "true" ]; then
51-
bash <(curl -s https://codecov.io/bash) -J '^GEOSwiftMapKit$';
52-
fi
34+
before_install: travis_wait 30 ./scripts/travis_before_install.sh
35+
script: ./scripts/travis_script.sh
36+
after_success: ./scripts/travis_after_success.sh

scripts/travis_after_success.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -evo pipefail
3+
4+
if [[ $RUN_CODECOV = 'true' ]]; then
5+
bash <(curl -s https://codecov.io/bash) -J '^GEOSwiftMapKit$';
6+
fi

scripts/travis_before_install.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -evo pipefail
3+
4+
if [[ $USE_SPM != 'true' ]]; then
5+
brew upgrade carthage swiftlint
6+
gem install xcpretty
7+
carthage update \
8+
--cache-builds \
9+
--platform "$PLATFORM" \
10+
--no-use-binaries
11+
fi

scripts/travis_script.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -evo pipefail
3+
4+
if [[ $USE_SPM = 'true' ]]; then
5+
swift test --enable-test-discovery
6+
else
7+
xcodebuild \
8+
-workspace "$WORKSPACE" \
9+
-scheme "$SCHEME" \
10+
-sdk "$SDK" \
11+
-destination "$DESTINATION" \
12+
-configuration Debug \
13+
ONLY_ACTIVE_ARCH=YES \
14+
clean test | xcpretty -c;
15+
fi

0 commit comments

Comments
 (0)