-
Notifications
You must be signed in to change notification settings - Fork 32
177 lines (151 loc) · 4.41 KB
/
ci.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI
on:
push:
branches:
- master
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- master
env:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#xcode
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
jobs:
env-details:
name: Environment details
runs-on: macos-14-arm64
steps:
- name: xcode version
run: xcodebuild -version -sdk
- name: list simulators
run: |
xcrun simctl delete unavailable
xcrun simctl list
build-test:
name: Build and Test
runs-on: macos-14-arm64
env:
WORKSPACE: Alicerce.xcworkspace
SCHEME: Alicerce
DERIVED_DATA_PATH: build
RESULT_BUNDLE_PATH: build-test.xcresult
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: install xcbeautify
run: brew install xcbeautify
- name: unit tests
run: |
set -o pipefail
xcodebuild clean build test \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-destination "$IOS_DESTINATION" \
-derivedDataPath "$DERIVED_DATA_PATH" \
-enableCodeCoverage YES \
-resultBundlePath "$RESULT_BUNDLE_PATH" \
| xcbeautify
- name: codecov upload
uses: codecov/codecov-action@v4
with:
xcode: true
xcode_archive_path: ${{ env.RESULT_BUNDLE_PATH }}
swiftpm:
name: SwiftPM Build
runs-on: macos-14-arm64
env:
WORKSPACE: Alicerce.xcworkspace
SCHEME: "Alicerce (SPM)"
steps:
- name: git checkout
uses: actions/checkout@v3
- name: install xcbeautify
run: brew install xcbeautify
- name: build
run: |
set -o pipefail
xcodebuild clean build \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-destination "$IOS_DESTINATION" \
| xcbeautify
cocoapods:
name: CocoaPods Verification
runs-on: macos-14-arm64
steps:
- name: git checkout
uses: actions/checkout@v3
- name: ruby versions
run: |
ruby --version
gem --version
bundler --version
- name: cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: pod lint
run: bundle exec pod lib lint
carthage:
name: Carthage Verification
runs-on: macos-14-arm64
steps:
- name: git checkout
uses: actions/checkout@v3
- name: carthage build
run: ./script/carthage.sh build --cache-builds --no-skip-current
release-github:
name: GitHub Release
runs-on: macos-14-arm64
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: git checkout
uses: actions/checkout@v3
- name: create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
# Changes
- <!-- Insert changes here -->
release-cocoapods:
name: CocoaPods Release
runs-on: macos-14-arm64
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: git checkout
uses: actions/checkout@v3
- name: ruby versions
run: |
ruby --version
gem --version
bundler --version
- name: cache gems
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: pod trunk push --allow-warnings