-
Notifications
You must be signed in to change notification settings - Fork 165
executable file
·282 lines (282 loc) · 11.3 KB
/
main.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: main
"on":
push:
branches:
- main
workflow_dispatch:
inputs:
publish-prerelease:
description: Indicates whether to publish the package to Sleet/npm
required: false
type: boolean
run-benchmark:
description: Indicates whether to run the benchmark tests
required: false
type: boolean
env:
REALM_DISABLE_ANALYTICS: true
DOTNET_NOLOGO: true
jobs:
build-wrappers:
uses: ./.github/workflows/wrappers.yml
name: Wrappers
deploy-baas:
uses: ./.github/workflows/deploy-baas.yml
with:
differentiators: '["net-framework", "code-coverage", "uwp-managed", "xamarinmacos", "ios", "android", "maccatalyst"]'
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
build-packages:
uses: ./.github/workflows/build-packages.yml
name: Package
needs:
- build-wrappers
publish-packages-to-sleet:
runs-on: ubuntu-latest
name: Publish package to S3
needs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && (github.event_name == 'push' || github.event.inputs.publish-prerelease)
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Fetch Realm.PlatformHelpers
uses: actions/download-artifact@v3
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm
uses: actions/download-artifact@v3
with:
name: Realm.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: 6.0.x
- name: Install sleet
run: dotnet tool install -g sleet
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.NUGET_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.NUGET_S3_SECRET_KEY }}
aws-region: us-east-1
- name: NuGet Publish Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
run: sleet push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource
- name: NuGet Publish Realm.${{ needs.build-packages.outputs.package_version }}
run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource
build-unity:
uses: ./.github/workflows/build-unity.yml
name: Package
with:
version: ${{ needs.build-packages.outputs.package_version }}
needs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
test-net-framework:
uses: ./.github/workflows/test-net-framework.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
test-uwp-managed:
uses: ./.github/workflows/test-uwp-managed.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
Pfx_Password: ${{ secrets.Pfx_Password }}
Base64_Encoded_Pfx: ${{ secrets.Base64_Encoded_Pfx }}
test-net-core:
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Test
needs:
- build-packages
uses: ./.github/workflows/test-net-core.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
framework: '["net6.0", "net7.0"]'
test-macos:
uses: ./.github/workflows/test-macos.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
test-ios:
uses: ./.github/workflows/test-ios.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
test-tvos:
uses: ./.github/workflows/test-tvos.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
test-android:
uses: ./.github/workflows/test-android.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
AWS_DEVICEFARM_ACCESS_KEY_ID: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }}
AWS_DEVICEFARM_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }}
DEVICEFARM_PROJECT_ARN: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
DEVICEFARM_ANDROID_POOL_ARN: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
test-xunit:
runs-on: windows-latest
name: Test xUnit Compatibility
timeout-minutes: 10
needs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Register csc problem matcher
run: echo "::add-matcher::.github/problem-matchers/csc.json"
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Fetch Realm.PlatformHelpers
uses: actions/download-artifact@v3
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm
uses: actions/download-artifact@v3
with:
name: Realm.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Publish Tests/Tests.XUnit
run: dotnet publish Tests/Tests.XUnit -c Release -f net6.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained
- name: Output executable path
id: dotnet-publish
run: echo 'executable-path=./Tests/Tests.XUnit/bin/Release/net6.0/win-x64' >> $GITHUB_OUTPUT
shell: bash
- name: Run Tests
run: dotnet test ${{ steps.dotnet-publish.outputs.executable-path }}/Tests.XUnit.dll --logger GitHubActions
test-weaver:
uses: ./.github/workflows/test-weaver.yml
name: Test
test-code-coverage:
uses: ./.github/workflows/test-code-coverage.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
- deploy-baas
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
benchmark-linux:
name: Benchmark Linux
needs: build-packages
runs-on: performance-tests
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && (github.event_name == 'push' || github.event.inputs.run-benchmark)
timeout-minutes: 60
steps:
- name: Cleanup Workspace
run: rm -rf "${{ github.workspace }}/*"
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Register csc problem matcher
run: echo "::add-matcher::.github/problem-matchers/csc.json"
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Fetch Realm.PlatformHelpers
uses: actions/download-artifact@v3
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm
uses: actions/download-artifact@v3
with:
name: Realm.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Clear nuget cache
run: dotnet nuget locals all --clear
- name: Publish Tests/Benchmarks/PerformanceTests
run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true --no-self-contained
- name: Output executable path
id: dotnet-publish
run: echo 'executable-path=./Tests/Benchmarks/PerformanceTests/bin/Release/net6.0/linux-x64' >> $GITHUB_OUTPUT
shell: bash
- name: Run the tests
run: ${{ steps.dotnet-publish.outputs.executable-path }}/PerformanceTests -f "*" --join
- name: Find Results file
id: find-results-file
run: |
cd BenchmarkDotNet.Artifacts/results
file=$(basename BenchmarkRun*json)
echo "benchmark-results=$file" >> $GITHUB_OUTPUT
shell: bash
- name: Publish Benchmark Results
uses: ./.github/actions/benchmark-uploader
with:
realm-token: ${{ secrets.Realm_Token }}
file: ${{ github.workspace }}/BenchmarkDotNet.Artifacts/results/${{ steps.find-results-file.outputs.benchmark-results }}
dashboard-path: dashboard.charts
nuget-package: ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg
- name: Store artifacts for dashboard.charts
uses: actions/upload-artifact@v3
with:
name: dashboard.charts
path: ${{ github.workspace }}/dashboard.charts
retention-days: 30
if-no-files-found: error
cleanup-baas:
uses: ./.github/workflows/cleanup-baas.yml
if: always()
name: Cleanup
needs:
- deploy-baas
- test-net-framework
- test-code-coverage
- test-uwp-managed
- test-macos
- test-ios
- test-android
with:
differentiators: '["net-framework", "code-coverage", "uwp-managed", "xamarinmacos", "ios", "android", "maccatalyst"]'
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}