Skip to content

Commit 09bceab

Browse files
committed
Apple Silicon M1 CI Resource Class
Based on https://circleci.com/blog/m1-mac-resource-class/ Xcode 14 ...for a valid build image. config.yml Ruby 2.6 Manual Ruby Install & Xcode 14.5 Just to see Add Space Quote me on that Corrected Ruby 3.0.6 Specify Xcode 13.4.1 Conditional? Extra Bashful Cleanup Revert "Cleanup" This reverts commit d5ef74e. Can this be separate? Version Trim Sourcery Chruby only Try Less Pruned Bundle Update Xcode 13 issue Split Route Use your words
1 parent 001139a commit 09bceab

File tree

4 files changed

+143
-35
lines changed

4 files changed

+143
-35
lines changed

.circleci/config.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ version: 2.1
22

33
jobs:
44
danger:
5-
executor: xcode-12
5+
executor: xcode-14
66
steps:
7-
- setup
7+
- setup-apple-silicon
88
- run:
99
name: Install xchtmlreport
1010
command: |
@@ -48,26 +48,32 @@ jobs:
4848
name: Danger
4949
when: always
5050
command: |
51-
if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; else echo "Skipping Danger for forked pull request."; fi
51+
if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger --verbose; else echo "Skipping Danger for forked pull request."; fi
5252
- run:
5353
name: Upload to Codecov
5454
when: always
5555
command: bash <(curl -s https://codecov.io/bash) -f build/BonMot-iOS/slather/cobertura.xml -X coveragepy -X gcov -X xcode
5656

5757
swift-package:
58-
executor: xcode-12
58+
executor: xcode-14
5959
steps:
60-
- setup
60+
- setup-apple-silicon
6161
- run: swift build
62-
- run: swift test
62+
- run: swift test --verbose
6363

6464
lint-pod:
65-
executor: xcode-12
65+
executor: xcode-14
6666
steps:
67-
- setup
67+
- setup-apple-silicon
6868
- lint-pod
6969

7070
fastlane-tests:
71+
executor: xcode-14
72+
steps:
73+
- setup-apple-silicon
74+
- run: bundle exec fastlane test_all --verbose
75+
76+
fastlane-tests-xcode-12:
7177
executor: xcode-12
7278
steps:
7379
- setup
@@ -80,7 +86,7 @@ jobs:
8086
- run: bundle exec fastlane test_all
8187

8288
carthage-build:
83-
executor: xcode-12
89+
executor: xcode-14
8490
steps:
8591
- checkout
8692
- run:
@@ -93,7 +99,7 @@ jobs:
9399
# - run: carthage build --no-skip-current && for platform in Mac iOS tvOS watchOS; do test -d Carthage/Build/${platform}/BonMot.framework || exit 1; done
94100

95101
deploy-to-cocoapods:
96-
executor: xcode-12
102+
executor: xcode-14
97103
steps:
98104
- setup
99105
- run: bundle exec pod trunk push
@@ -109,14 +115,47 @@ executors:
109115
shell: /bin/bash --login -eo pipefail
110116
xcode-13:
111117
macos:
112-
xcode: "13.0.0"
118+
xcode: "13.4.1"
119+
environment:
120+
LC_ALL: en_US.UTF-8
121+
LANG: en_US.UTF-8
122+
HOMEBREW_NO_AUTO_UPDATE: 1
123+
shell: /bin/bash --login -eo pipefail
124+
xcode-14:
125+
macos:
126+
xcode: "14.3.1"
127+
resource_class: macos.m1.large.gen1
113128
environment:
114129
LC_ALL: en_US.UTF-8
115130
LANG: en_US.UTF-8
116131
HOMEBREW_NO_AUTO_UPDATE: 1
117132
shell: /bin/bash --login -eo pipefail
118133

119134
commands:
135+
136+
setup-apple-silicon:
137+
description: "Shared Apple Silicon setup"
138+
steps:
139+
- checkout
140+
- restore-gems-apple-silicon
141+
142+
restore-gems-apple-silicon:
143+
description: "Restore Ruby Gems: Apple Silicon"
144+
steps:
145+
- run:
146+
name: Ruby Setup
147+
command: bash ./.circleci/ruby_setup.sh
148+
- run:
149+
name: Set Ruby Version
150+
command: bash ./.circleci/ruby_version.sh
151+
- restore_cache:
152+
key: 1-gems-{{ checksum "Gemfile.lock" }}
153+
- run: bundle check || bundle install --path vendor/bundle
154+
- save_cache:
155+
key: 1-gems-{{ checksum "Gemfile.lock" }}
156+
paths:
157+
- vendor/bundle
158+
120159
setup:
121160
description: "Shared setup"
122161
steps:
@@ -127,8 +166,8 @@ commands:
127166
description: "Restore Ruby Gems"
128167
steps:
129168
- run:
130-
name: Set Ruby Version
131-
command: echo "ruby-2.5" > ~/.ruby-version
169+
name: Set Ruby Version
170+
command: echo "ruby-2.5" > ~/.ruby-version
132171
- restore_cache:
133172
key: 1-gems-{{ checksum "Gemfile.lock" }}
134173
- run: bundle check || bundle install --path vendor/bundle
@@ -166,6 +205,10 @@ workflows:
166205
filters:
167206
tags:
168207
only: /.*/
208+
- fastlane-tests-xcode-12:
209+
filters:
210+
tags:
211+
only: /.*/
169212
- lint-pod:
170213
filters:
171214
tags:
@@ -181,6 +224,7 @@ workflows:
181224
- swift-package
182225
- fastlane-tests
183226
- fastlane-tests-xcode-13
227+
- fastlane-tests-xcode-12
184228
- lint-pod
185229
- carthage-build
186230
filters:

.circleci/ruby_setup.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash -eo pipefail
2+
3+
# Ensure any error stops the script
4+
set -e
5+
6+
# Check if Homebrew is installed
7+
if ! command -v brew &> /dev/null; then
8+
echo "Homebrew not found. Please install it first."
9+
exit 1
10+
fi
11+
12+
# Check if rbenv is installed; if not, install it
13+
if ! command -v rbenv &> /dev/null; then
14+
echo "Installing rbenv..."
15+
brew install rbenv
16+
# Check if rbenv init line is already present in .bash_profile, if not, add it
17+
if ! grep -q 'eval "$(rbenv init -)"' ~/.bash_profile; then
18+
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
19+
fi
20+
21+
source ~/.bash_profile
22+
else
23+
echo "rbenv is already installed."
24+
fi
25+
26+
# Check if ruby-build is installed; if not, install it
27+
if ! brew list ruby-build &> /dev/null; then
28+
echo "Installing ruby-build..."
29+
brew install ruby-build
30+
else
31+
echo "ruby-build is already installed."
32+
fi
33+
34+
# Ensure ruby-build is up-to-date
35+
brew update && brew upgrade ruby-build
36+
37+
# Check if Ruby 3.0.6 is already installed; if not, install it
38+
if ! rbenv versions | grep -q 3.0.6; then
39+
echo "Installing Ruby 3.0.6..."
40+
rbenv install 3.0.6
41+
else
42+
echo "Ruby 3.0.6 is already installed."
43+
fi
44+
45+
# Set the global Ruby version to 3.0.6
46+
echo "Setting global Ruby version to 3.0.6..."
47+
rbenv global 3.0.6

.circleci/ruby_version.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash -eo pipefail
2+
3+
# Ensure any error stops the script
4+
set -e
5+
6+
# Ensure rbenv is properly initialized
7+
if ! command -v rbenv &> /dev/null; then
8+
echo "rbenv not found. Please install it first."
9+
exit 1
10+
fi
11+
12+
echo "Initializing rbenv..."
13+
source ~/.bash_profile
14+
15+
# Set the global Ruby version to 3.0.6
16+
echo "Setting global Ruby version to 3.0.6..."
17+
rbenv global 3.0.6

Gemfile.lock

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ GEM
33
specs:
44
CFPropertyList (3.0.6)
55
rexml
6-
activesupport (7.0.5)
6+
activesupport (7.0.7)
77
concurrent-ruby (~> 1.0, >= 1.0.2)
88
i18n (>= 1.6, < 2)
99
minitest (>= 5.1)
1010
tzinfo (~> 2.0)
11-
addressable (2.8.4)
11+
addressable (2.8.5)
1212
public_suffix (>= 2.0.2, < 6.0)
1313
algoliasearch (1.27.5)
1414
httpclient (~> 2.8, >= 2.8.3)
1515
json (>= 1.5.1)
1616
artifactory (3.0.15)
1717
atomos (0.1.3)
1818
aws-eventstream (1.2.0)
19-
aws-partitions (1.777.0)
20-
aws-sdk-core (3.174.0)
19+
aws-partitions (1.805.0)
20+
aws-sdk-core (3.180.3)
2121
aws-eventstream (~> 1, >= 1.0.2)
2222
aws-partitions (~> 1, >= 1.651.0)
2323
aws-sigv4 (~> 1.5)
2424
jmespath (~> 1, >= 1.6.1)
25-
aws-sdk-kms (1.66.0)
26-
aws-sdk-core (~> 3, >= 3.174.0)
25+
aws-sdk-kms (1.71.0)
26+
aws-sdk-core (~> 3, >= 3.177.0)
2727
aws-sigv4 (~> 1.1)
28-
aws-sdk-s3 (1.123.1)
29-
aws-sdk-core (~> 3, >= 3.174.0)
28+
aws-sdk-s3 (1.132.1)
29+
aws-sdk-core (~> 3, >= 3.179.0)
3030
aws-sdk-kms (~> 1)
31-
aws-sigv4 (~> 1.4)
32-
aws-sigv4 (1.5.2)
31+
aws-sigv4 (~> 1.6)
32+
aws-sigv4 (1.6.0)
3333
aws-eventstream (~> 1, >= 1.0.2)
3434
babosa (1.0.4)
3535
circleci (2.1.0)
@@ -109,7 +109,7 @@ GEM
109109
danger (>= 2.1)
110110
xcov (>= 1.7.3)
111111
declarative (0.0.20)
112-
digest-crc (0.6.4)
112+
digest-crc (0.6.5)
113113
rake (>= 12.0.0, < 14.0.0)
114114
domain_name (0.5.20190701)
115115
unf (>= 0.0.5, < 1.0.0)
@@ -150,7 +150,7 @@ GEM
150150
faraday_middleware (1.2.0)
151151
faraday (~> 1.0)
152152
fastimage (2.2.7)
153-
fastlane (2.213.0)
153+
fastlane (2.214.0)
154154
CFPropertyList (>= 2.3, < 4.0.0)
155155
addressable (>= 2.8, < 3.0.0)
156156
artifactory (~> 3.0)
@@ -196,9 +196,9 @@ GEM
196196
git (1.18.0)
197197
addressable (~> 2.8)
198198
rchardet (~> 1.8)
199-
google-apis-androidpublisher_v3 (0.43.0)
199+
google-apis-androidpublisher_v3 (0.48.0)
200200
google-apis-core (>= 0.11.0, < 2.a)
201-
google-apis-core (0.11.0)
201+
google-apis-core (0.11.1)
202202
addressable (~> 2.5, >= 2.5.1)
203203
googleauth (>= 0.16.2, < 2.a)
204204
httpclient (>= 2.8.1, < 3.a)
@@ -227,7 +227,7 @@ GEM
227227
google-cloud-core (~> 1.6)
228228
googleauth (>= 0.16.2, < 2.a)
229229
mini_mime (~> 1.0)
230-
googleauth (1.5.2)
230+
googleauth (1.7.0)
231231
faraday (>= 0.17.3, < 3.a)
232232
jwt (>= 1.4, < 3.0)
233233
memoist (~> 0.16)
@@ -249,9 +249,9 @@ GEM
249249
kramdown (~> 2.0)
250250
memoist (0.16.2)
251251
mini_magick (4.12.0)
252-
mini_mime (1.1.2)
253-
mini_portile2 (2.8.2)
254-
minitest (5.18.0)
252+
mini_mime (1.1.5)
253+
mini_portile2 (2.8.4)
254+
minitest (5.19.0)
255255
molinillo (0.8.0)
256256
multi_json (1.15.0)
257257
multipart-post (2.3.0)
@@ -260,7 +260,7 @@ GEM
260260
naturally (2.2.1)
261261
netrc (0.11.0)
262262
no_proxy_fix (0.1.2)
263-
nokogiri (1.15.2)
263+
nokogiri (1.15.4)
264264
mini_portile2 (~> 2.8.2)
265265
racc (~> 1.4)
266266
octokit (6.1.1)
@@ -269,18 +269,18 @@ GEM
269269
open4 (1.3.4)
270270
optparse (0.1.1)
271271
os (1.1.4)
272-
ox (2.14.16)
272+
ox (2.14.17)
273273
plist (3.7.0)
274274
public_suffix (4.0.7)
275-
racc (1.7.0)
275+
racc (1.7.1)
276276
rake (13.0.6)
277277
rchardet (1.8.0)
278278
representable (3.2.0)
279279
declarative (< 0.1.0)
280280
trailblazer-option (>= 0.1.1, < 0.2.0)
281281
uber (< 0.2.0)
282282
retriable (3.1.2)
283-
rexml (3.2.5)
283+
rexml (3.2.6)
284284
rouge (2.0.7)
285285
ruby-macho (2.5.1)
286286
ruby2_keywords (0.0.5)

0 commit comments

Comments
 (0)