Starting one cluster per platform on CI #1587
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |