forked from semaphoreci-demos/semaphore-demo-ios-swift-xcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
semaphore.yml
128 lines (115 loc) · 5.01 KB
/
semaphore.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
# Use the latest stable version of Semaphore 2.0 YML syntax:
version: v1.0
# Name your pipeline. If you choose to connect multiple pipelines with
# promotions, the pipeline name will help you differentiate between
# them. For example, you might have a build phase and a delivery phase.
# For more information on promotions, see:
# https://docs.semaphoreci.com/article/67-deploying-with-promotions
name: Tallest Towers
# The agent defines the environment in which your CI runs. It is a combination
# of a machine type and an operating system image. For a project built with
# Xcode you must use one of the Apple machine types, coupled with a macOS image
# running either Xcode 11 or Xcode 12.
# See https://docs.semaphoreci.com/article/20-machine-types
# https://docs.semaphoreci.com/ci-cd-environment/macos-xcode-11-image/ and
# https://docs.semaphoreci.com/ci-cd-environment/macos-xcode-12-image/
agent:
machine:
type: a1-standard-4
os_image: macos-xcode12
# Blocks are the heart of a pipeline and are executed sequentially. Each block
# has a task that defines one or more parallel jobs. Jobs define commands that
# should be executed by the pipeline.
# See https://docs.semaphoreci.com/article/62-concepts
blocks:
- name: Run tests
task:
# Set environment variables that your project requires.
# See https://docs.semaphoreci.com/article/66-environment-variables-and-secrets
env_vars:
- name: LANG
value: en_US.UTF-8
prologue:
commands:
# Download source code from GitHub.
- checkout
# Restore dependencies from cache. This command will not fail in
# case of a cache miss. In case of a cache hit, bundle install will
# complete in about a second.
# See https://docs.semaphoreci.com/article/68-caching-dependencies
- cache restore
# Fix for: `find_spec_for_exe': can't find gem bundler erro
# Look at the end of Gemfile.lock, under BUNDLED WITH
# and simply install the required version before calling bundle install
- gem install bundler -v '2.1.4'
- bundle install --path vendor/bundle
- cache store
jobs:
- name: Test
commands:
# Select an Xcode version.
# See https://docs.semaphoreci.com/article/161-macos-mojave-xcode-10-image and
# https://docs.semaphoreci.com/article/162-macos-mojave-xcode-11-image
- bundle exec xcversion select 12.2
# Run tests of iOS and Mac app on a simulator or connected device.
# See https://docs.fastlane.tools/actions/scan/
- bundle exec fastlane test
- name: Build app
task:
env_vars:
- name: LANG
value: en_US.UTF-8
secrets:
# Make the SSH key for the certificate repository and the MATCH_PASSWORD
# environment variable available.
# See https://docs.semaphoreci.com/article/109-using-private-dependencies
- name: match-secrets
prologue:
commands:
# Add the key for the match certificate repository to ssh
# See https://docs.semaphoreci.com/article/109-using-private-dependencies
- chmod 0600 ~/.ssh/*
- ssh-add ~/.ssh/match-repository-private-key
# Continue with checkout as normal
- checkout
- cache restore
# Fix for: `find_spec_for_exe': can't find gem bundler erro
# Look at the end of Gemfile.lock, under BUNDLED WITH
# and simply install the required version before calling bundle install
- gem install bundler -v '2.1.4'
- bundle install --path vendor/bundle
- cache store
jobs:
- name: Build
commands:
- bundle exec xcversion select 12.2
- bundle exec fastlane build
# Upload the IPA file as a job artifact.
# See https://docs.semaphoreci.com/article/155-artifacts
- artifact push job build/TallestTowers.ipa
- name: Take screenshots
task:
env_vars:
- name: LANG
value: en_US.UTF-8
prologue:
commands:
- checkout
- cache restore
# Fix for: `find_spec_for_exe': can't find gem bundler erro
# Look at the end of Gemfile.lock, under BUNDLED WITH
# and simply install the required version before calling bundle install
- gem install bundler -v '2.1.4'
- bundle install --path vendor/bundle
- cache store
jobs:
- name: Screenshots
commands:
- bundle exec xcversion select 12.2
# Fix for fastlane snapshot not allways finding the simular.
# In case you find errors like "Simulator not found", use this workarround
- xcrun simctl list
- bundle exec fastlane screenshots
# Upload the screenshots directory as a project artifact.
# See https://docs.semaphoreci.com/article/155-artifacts
- artifact push job screenshots