-
Notifications
You must be signed in to change notification settings - Fork 313
163 lines (143 loc) · 5.19 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
name: CI
on:
pull_request:
push:
branches:
- master
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer
FASTLANE_SKIP_UPDATE_CHECK: true
FASTLANE_XCODE_LIST_TIMEOUT: 80
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 80
HOMEBREW_NO_INSTALL_CLEANUP: TRUE
BUNDLE_PATH: vendor/bundle
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: YamlLint
run: yamllint --strict --format github .
- name: RuboCop
run: bundle exec rubocop --format github
- name: SwiftLint
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` \
ghcr.io/realm/swiftlint:0.54.0 \
swiftlint lint --strict --config .swiftlint.yml --reporter github-actions-logging
- name: SwiftFormat
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` \
ghcr.io/nicklockwood/swiftformat:0.53.1 \
--lint --config .swiftformat .
test:
runs-on: macos-14
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
name: "Cache: Pods"
id: cache_pods
with:
path: |
Pods
Tools/MaterialDesignIcons.ttf
Tools/MaterialDesignIcons.json
key: >-
${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}
- uses: actions/cache@v4
name: "Cache: Gems"
id: cache_gems
with:
path: vendor/bundle
key: >-
${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ env.DEVELOPER_DIR }}-${{ hashFiles('**/Gemfile.lock') }}
- name: Install Brews
# right now, we don't need anything from brew for tests, so save some time
if: ${{ false }}
run: brew bundle
- name: Install Gems
if: steps.cache_gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: Install Pods Release
if: steps.cache_pods.outputs.cache-hit != 'true'
run: bundle exec pod install --repo-update
- name: Run tests
run: bundle exec fastlane test
- uses: codecov/[email protected]
name: "Upload Code Coverage"
with:
xcode: true
xcode_archive_path: fastlane/test_output/Tests-Unit.xcresult
- uses: actions/upload-artifact@v4
name: "Upload Test Logs"
if: ${{ always() }}
with:
name: test-logs
path: |
~/Library/Logs/DiagnosticReports
~/Library/Developer/Xcode/DerivedData/HomeAssistant-*/Logs/Test
~/Library/Logs/scan
- uses: actions/upload-artifact@v4
name: "Upload Simulator App"
with:
name: ios-simulator
path: ~/Library/Developer/Xcode/DerivedData/HomeAssistant-*/Build/Products/Debug-iphonesimulator/*.app
size:
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == 'home-assistant/iOS'
runs-on: macos-14
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
name: "Cache: Pods"
id: cache_pods
with:
path: |
Pods
Tools/MaterialDesignIcons.ttf
Tools/MaterialDesignIcons.json
key: >-
${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}
- uses: actions/cache@v4
name: "Cache: Gems"
id: cache_gems
with:
path: vendor/bundle
key: >-
${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ env.DEVELOPER_DIR }}-${{ hashFiles('**/Gemfile.lock') }}
- name: Install Brews
# right now, we don't need anything from brew for sizing, so save some time
if: ${{ false }}
run: brew bundle
- name: Install Gems
if: steps.cache_gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: Install Pods Release
if: steps.cache_pods.outputs.cache-hit != 'true'
run: bundle exec pod install --repo-update
- name: Build app
run: bundle exec fastlane ios size
env:
P12_KEY_IOS_APP_STORE: ${{ secrets.P12_KEY_IOS_APP_STORE }}
P12_KEY_MAC_APP_STORE: ${{ secrets.P12_KEY_MAC_APP_STORE }}
P12_KEY_MAC_DEVELOPER_ID: ${{ secrets.P12_KEY_MAC_DEVELOPER_ID }}
P12_VALUE_IOS_APP_STORE: ${{ secrets.P12_VALUE_IOS_APP_STORE }}
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
EMERGE_REPO_NAME: ${{ github.repository }}
EMERGE_PR_NUMBER: ${{ github.event.number }}
EMERGE_SHA: ${{ github.event.pull_request.head.sha }}
EMERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}