-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (157 loc) · 6.97 KB
/
Build-Genius.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Build Genius
on:
push:
paths:
- .github/workflows/Build-Genius.yml
- .periphery.yml
- .swift-version
- .swiftformat
- .swiftlint.yml
- Genius/**
- Genius.xcodeproj/**
- GeniusTests/**
pull_request:
paths:
- .github/workflows/Build-Genius.yml
- .periphery.yml
- .swift-version
- .swiftformat
- .swiftlint.yml
- Genius/**
- Genius.xcodeproj/**
- GeniusTests/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ github.token }}
NSUnbufferedIO: YES
jobs:
Run-Periphery:
name: Run Periphery
runs-on: macos-15
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@master
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@main
- name: Install Periphery
run: |
latest_periphery_tag=$(gh release --repo peripheryapp/periphery list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/peripheryapp/periphery/releases/download/"$latest_periphery_tag"/periphery-"$latest_periphery_tag".zip --output periphery.zip
unzip periphery.zip
echo "Periphery $(./periphery version) installed"
- name: Run Periphery
run: ./periphery scan --format github-actions --relative-results --strict -- -skipPackagePluginValidation
Run-SwiftFormat:
name: Run SwiftFormat
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Install SwiftFormat
run: |
curl --remote-name --location https://github.com/nicklockwood/SwiftFormat/releases/latest/download/swiftformat.zip
unzip swiftformat.zip
echo "SwiftFormat $(./swiftformat --version) installed"
- name: Run SwiftFormat
run: ./swiftformat --lint . --reporter github-actions-log
Run-SwiftLint:
name: Run SwiftLint
runs-on: macos-15
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@master
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@main
- name: Install SwiftLint
run: |
curl --remote-name --location https://github.com/realm/SwiftLint/releases/latest/download/portable_swiftlint.zip
unzip portable_swiftlint.zip
echo "SwiftLint $(./swiftlint version) installed"
- name: Run SwiftLint Lint Rules
run: ./swiftlint lint --strict --reporter github-actions-logging
- name: Install xcbeautify
run: |
latest_xcbeautify_tag=$(gh release --repo cpisciotta/xcbeautify list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/cpisciotta/xcbeautify/releases/download/"$latest_xcbeautify_tag"/xcbeautify-"$latest_xcbeautify_tag"-arm64-apple-macosx.zip --output xcbeautify.zip
unzip xcbeautify.zip
echo "xcbeautify $(./xcbeautify --version) installed"
- name: Build Genius
run: |
set -o pipefail
xcodebuild build -scheme Genius -destination generic/platform=macOS -skipPackagePluginValidation | tee xcodebuild.log | ./xcbeautify --disable-logging --renderer github-actions
- name: Run SwiftLint Analyzer Rules
run: ./swiftlint analyze --strict --reporter github-actions-logging --compiler-log-path xcodebuild.log
Run-Tests:
name: Run Tests
runs-on: macos-15
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@master
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@main
- name: Install xcbeautify
run: |
latest_xcbeautify_tag=$(gh release --repo cpisciotta/xcbeautify list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/cpisciotta/xcbeautify/releases/download/"$latest_xcbeautify_tag"/xcbeautify-"$latest_xcbeautify_tag"-arm64-apple-macosx.zip --output xcbeautify.zip
unzip xcbeautify.zip
echo "xcbeautify $(./xcbeautify --version) installed"
- name: Run Tests
run: |
set -o pipefail
xcodebuild test -scheme Genius -destination platform=macOS,arch=arm64 -skipPackagePluginValidation | ./xcbeautify --disable-logging --renderer github-actions
Build-Genius:
name: Build Genius
runs-on: macos-15
permissions:
id-token: write
attestations: write
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@master
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@main
- name: Install xcbeautify
run: |
latest_xcbeautify_tag=$(gh release --repo cpisciotta/xcbeautify list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/cpisciotta/xcbeautify/releases/download/"$latest_xcbeautify_tag"/xcbeautify-"$latest_xcbeautify_tag"-arm64-apple-macosx.zip --output xcbeautify.zip
unzip xcbeautify.zip
echo "xcbeautify $(./xcbeautify --version) installed"
- name: Build Genius
run: |
set -o pipefail
xcodebuild archive -scheme Genius -destination generic/platform=macOS -archivePath Genius -skipPackagePluginValidation | ./xcbeautify --disable-logging --renderer github-actions
- name: Zip Genius
run: |
mv Genius.xcarchive/Products/Applications/Genius.app .
zip --recurse-paths Genius.zip Genius.app
- name: Attest Build Provenance
uses: actions/attest-build-provenance@main
with:
subject-path: Genius.zip
- name: Upload Genius
uses: actions/upload-artifact@main
with:
name: Genius
path: Genius.zip
- name: Zip Debug Symbols
run: |
mv Genius.xcarchive/dSYMs/Genius.app.dSYM .
zip --recurse-paths DebugSymbols.zip Genius.app.dSYM
- name: Upload Debug Symbols
uses: actions/upload-artifact@main
with:
name: Debug Symbols
path: DebugSymbols.zip