Skip to content

Commit 5528769

Browse files
authored
Improve CircleCI configuration (#37)
1 parent cfff80e commit 5528769

File tree

1 file changed

+33
-35
lines changed

1 file changed

+33
-35
lines changed

.circleci/config.yml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
type: string
77
ios-sim:
88
type: string
9+
build-universal:
10+
type: boolean
11+
default: true
912
build-doc:
1013
type: boolean
1114
default: false
@@ -31,6 +34,14 @@ jobs:
3134
command: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | tee 'artifacts/raw-logs-macosx.txt' | xcpretty -r junit -o 'test-results/platform-macosx/junit.xml'
3235
when: always
3336

37+
- when:
38+
condition: <<parameters.build-universal>>
39+
steps:
40+
- run:
41+
name: Build for ARM64 macOS
42+
command: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | tee 'artifacts/raw-logs-macosx-arm64e.txt' | xcpretty
43+
when: always
44+
3445
- run:
3546
name: Build Tests for iOS device
3647
command: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk iphoneos CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-iphoneos.txt' | xcpretty
@@ -69,11 +80,26 @@ jobs:
6980
- when:
7081
condition: <<parameters.build-doc>>
7182
steps:
83+
- restore_cache:
84+
key: v1-gem-cache-<<parameters.xcode-version>>-
85+
7286
- run:
73-
name: Build Documentation
87+
name: Install jazzy gem
7488
command: |
75-
sudo gem install jazzy
76-
jazzy -o artifacts/docs
89+
gem install jazzy
90+
gem cleanup
91+
# Used as cache key to prevent storing redundant caches
92+
gem list > /tmp/cache-key.txt
93+
94+
- save_cache:
95+
key: v1-gem-cache-<<parameters.xcode-version>>-{{ checksum "/tmp/cache-key.txt" }}
96+
paths:
97+
- ~/.gem
98+
99+
- run:
100+
name: Build Documentation
101+
command: jazzy -o artifacts/docs
102+
77103
- run:
78104
name: Validate coverage
79105
command: |
@@ -86,35 +112,6 @@ jobs:
86112
- store_artifacts:
87113
path: artifacts
88114

89-
build_macos_universal:
90-
macos:
91-
xcode: '12.2.0'
92-
93-
steps:
94-
- checkout
95-
96-
- run:
97-
name: Setup for builds
98-
command: |
99-
mkdir -p 'test-results'
100-
mkdir -p 'artifacts'
101-
102-
- run:
103-
name: Build for ARM64 macOS
104-
command: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | tee 'artifacts/raw-logs-macosx-arm64e.txt' | xcpretty
105-
when: always
106-
107-
- run:
108-
name: Build & Test on x86_64 macOS Simulator
109-
command: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | tee 'artifacts/raw-logs-macosx-x86_64.txt' | xcpretty -r junit -o 'test-results/platform-macosx-x86_64/junit.xml'
110-
when: always
111-
112-
- store_test_results:
113-
path: test-results
114-
115-
- store_artifacts:
116-
path: artifacts
117-
118115
build_linux:
119116
parameters:
120117
docker-image:
@@ -154,8 +151,8 @@ workflows:
154151
build:
155152
jobs:
156153
- build:
157-
name: Xcode 13.0 - Swift 5.5
158-
xcode-version: '13.0.0'
154+
name: Xcode 13.1 - Swift 5.5
155+
xcode-version: '13.1.0'
159156
ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.0'
160157
build-doc: true
161158
- build:
@@ -170,10 +167,12 @@ workflows:
170167
name: Xcode 11.4 - Swift 5.2
171168
xcode-version: '11.4.1'
172169
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.2'
170+
build-universal: false
173171
- build:
174172
name: Xcode 11.0 - Swift 5.1
175173
xcode-version: '11.0.0'
176174
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.2'
175+
build-universal: false
177176
- build_linux:
178177
name: Linux - Swift 5.4
179178
docker-image: norionomura/swift:5.4
@@ -189,4 +188,3 @@ workflows:
189188
name: Linux - Swift 5.1
190189
docker-image: norionomura/swift:5.1
191190
discover-tests: true
192-
- build_macos_universal

0 commit comments

Comments
 (0)