forked from optimizely/swift-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
136 lines (127 loc) · 5.02 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: minimal
os: linux
# Integration tests need to run first to reset the PR build status to pending
stages:
- name: 'Source Clear'
- name: 'Lint markdown files'
- name: 'Trigger Integration Tests'
if: env(RUN_COMPAT_SUITE) = true and env(PREP) IS NOT present and env(RELEASE) IS NOT present
- name: 'Lint'
- name: 'Unit Tests'
if: env(PREP) IS NOT present and env(RELEASE) IS NOT present
- name: 'Prepare for release'
if: env(PREP) = true and type = api
- name: 'Release'
if: env(RELEASE) = true and type = api
jobs:
include:
- stage: 'Lint markdown files'
os: linux
language: generic
install: gem install awesome_bot
script:
- find . -type f -name '*.md' -exec awesome_bot {} \;
notifications:
email: false
- stage: 'Trigger Integration Tests'
language: minimal
os: linux
env:
- SDK=swift
- BUILD_NUMBER=${TRAVIS_JOB_NUMBER/.}
- TESTAPP_TAG=master
- SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
cache: false
install:
- mkdir $HOME/travisci-tools && pushd $HOME/travisci-tools && git init && git pull https://$CI_USER_TOKEN@github.com/optimizely/travisci-tools.git && popd
script:
- $HOME/travisci-tools/trigger-script-with-status-update.sh
- stage: 'Lint'
language: swift
os: osx
osx_image: xcode12.4
install:
- gem install cocoapods -v '1.9.3'
script:
- pod spec lint --quick
after_script:
- curl -sSL https://download.sourceclear.com/ci.sh | bash
- stage: 'Source Clear'
if: type = cron
addons:
srcclr: true
before_install: skip
install: skip
before_script: skip
script: skip
after_success: skip
- &unittests
stage: 'Unit Tests'
language: swift
os: osx
osx_image: xcode12.4
branches:
only:
- master
env: COVERAGE_DIR=./COVERAGE SCHEME=OptimizelySwiftSDK-iOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=14.4 NAME='iPhone 11'
name: PLATFORM='iOS Simulator' OS=14.4 NAME='iPhone 11'
install:
#- gem install slather --no-document --quiet
- gem install coveralls-lcov
#
- gem install cocoapods -v '1.9.3'
- pod repo update
- pod install
# install jq without cleaning up
- HOMEBREW_NO_INSTALL_CLEANUP=true brew update && brew install jq
# preload simulator
- Scripts/start_simulator.sh
script:
- Scripts/run_unit_tests.sh
after_success:
- Scripts/upload_coveralls.sh
- sleep 5 # https://github.com/travis-ci/travis-ci/issues/4725
after_failure:
# install travis artifacts uploader
- sudo curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
- artifacts upload --target-paths "/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/xcodebuild_logs" $(find /Users/travis/Library/Developer/Xcode/ -name *.xcresult -o -name *.log)
- artifacts upload --target-paths "/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/buildoutput" "$TRAVIS_BUILD_DIR/buildoutput"
- <<: *unittests
env: COVERAGE_DIR=./COVERAGE SCHEME=OptimizelySwiftSDK-iOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=13.3 NAME='iPhone 8'
name: PLATFORM='iOS Simulator' OS=13.3 NAME='iPhone 8'
- <<: *unittests
env: COVERAGE_DIR=./COVERAGE SCHEME=OptimizelySwiftSDK-iOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=11.4 NAME='iPad Air'
name: PLATFORM='iOS Simulator' OS=11.4 NAME='iPad Air'
- <<: *unittests
env: COVERAGE_DIR=./COVERAGE SCHEME=OptimizelySwiftSDK-tvOS TEST_SDK=appletvsimulator PLATFORM='tvOS Simulator' OS=12.1 NAME='Apple TV 4K'
name: PLATFORM='tvOS Simulator' OS=12.1 NAME='Apple TV 4K'
- stage: 'Prepare for release'
name: Prepare for release
language: swift
os: osx
osx_image: xcode12.4
env:
- VERSION=3.10.0
install:
# install hub
- wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub
# upgrade cocoapods
- gem install cocoapods -v '1.9.3'
script:
- Scripts/run_prep.sh
after_failure:
- cat /tmp/build.out
- stage: 'Release'
name: Push to cocoapods.org
language: minimal
os: osx
osx_image: xcode12.4
env:
- VERSION=3.10.0
install:
# install hub
- wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub
# upgrade cocoapods
- gem install cocoapods -v '1.9.3'
script:
- Scripts/run_release.sh