-
Notifications
You must be signed in to change notification settings - Fork 165
executable file
·238 lines (234 loc) · 8.45 KB
/
pr.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
name: PR Build
"on":
pull_request:
paths:
- '**.cs'
- '**.cpp'
- '**.hpp'
- '**.csproj'
- '**CMakeLists.txt'
- '**.ps1'
- '**.sh'
- '**.props'
- wrappers/realm-core
- .github/workflows/*.yml
- '!.github/workflows/main.yml'
- '!.github/workflows/publish-*.yml'
- .github/actions/**
env:
REALM_DISABLE_ANALYTICS: true
DOTNET_NOLOGO: true
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-wrappers:
uses: ./.github/workflows/wrappers.yml
name: Wrappers
deploy-cluster:
uses: ./.github/workflows/deploy-baas.yml
with:
differentiators: '["code-coverage"]'
BaseUrl: https://realm-qa.mongodb.com
AtlasBaseUrl: https://cloud-qa.mongodb.com
secrets:
AtlasProjectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
AtlasPublicKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
AtlasPrivateKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
build-packages:
uses: ./.github/workflows/build-packages.yml
name: Package
needs:
- build-wrappers
with:
build-docs: ${{ contains(github.head_ref, 'release') }}
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-unity:
uses: ./.github/workflows/test-unity.yml
name: Test
with:
version: ${{ needs.build-packages.outputs.package_version }}
settings: '["Mono-Net4"]'
platform: '[{ "os": "windows", "testPlatform": "Windows64" }, { "os": "linux", "testPlatform": "Linux64" }]'
needs:
- build-packages
- build-unity
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
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
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
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
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: '["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
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
test-ios:
uses: ./.github/workflows/test-ios.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-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
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
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-weaved-classes:
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Test
needs:
- build-packages
uses: ./.github/workflows/test-woven-classes.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
test-source-generation:
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Test
uses: ./.github/workflows/test-source-generation.yml
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-cluster
with:
version: ${{ needs.build-packages.outputs.package_version }}
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
realmUrl: https://realm-qa.mongodb.com
atlasUrl: https://cloud-qa.mongodb.com
secrets:
AtlasProjectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
AtlasPublicKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
AtlasPrivateKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
cleanup-cluster:
uses: ./.github/workflows/cleanup-baas.yml
if: always()
name: Cleanup
needs:
- deploy-cluster
- test-code-coverage
with:
differentiators: '["code-coverage"]'
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
BaseUrl: https://realm-qa.mongodb.com
AtlasBaseUrl: https://cloud-qa.mongodb.com
secrets:
AtlasProjectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
AtlasPublicKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
AtlasPrivateKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
verify-namespaces:
runs-on: ubuntu-latest
name: Verify Namespaces
needs:
- build-packages
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
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: Fetch Realm.UnityUtils
uses: actions/download-artifact@v3
with:
name: Realm.UnityUtils.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.UnityWeaver
uses: actions/download-artifact@v3
with:
name: Realm.UnityWeaver.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- run: dotnet tool install ilspycmd -g --version 8.0.0.7345
- name: Verify Namespaces
run: |
$isFailure = $false
Get-ChildItem ./Realm/packages -Filter *.nupkg | Foreach-Object {
$targetPath = Join-Path ./Realm/packages $_.BaseName
Expand-Archive $_.FullName -DestinationPath $targetPath
Get-ChildItem $targetPath -Filter *.dll -Recurse | ForEach-Object {
if (-not ($_.FullName -match "runtimes")) {
$ilspyOutput = ilspycmd $_.FullName
$parentDll = $_.FullName
$ilspyOutput | ForEach-Object {
if ($_ -match "namespace.*Realm(\.|$)") {
Write-Output "::error file=$parentDll::Realm present in namespace - $($_)"
Set-Variable "isFailure" -Value $true
}
}
}
}
}
if ($isFailure) {
exit 1
}
shell: pwsh