Skip to content

Commit

Permalink
Replace pr.yml with one generated from pkl
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed May 13, 2024
1 parent 93bbd4b commit f679464
Showing 1 changed file with 55 additions and 57 deletions.
112 changes: 55 additions & 57 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Do not modify!
# This file was generated from a template using https://github.com/apple/pkl

name: PR Build
"on":
'on':
pull_request:
paths:
- '**.cs'
Expand All @@ -24,166 +27,161 @@ concurrency:
cancel-in-progress: true
jobs:
build-wrappers:
uses: ./.github/workflows/wrappers.yml
name: Wrappers
uses: ./.github/workflows/wrappers.yml
deploy-baas:
uses: ./.github/workflows/deploy-baas.yml
with:
differentiators: '["code-coverage"]'
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
build-packages:
uses: ./.github/workflows/build-packages.yml
name: Package
needs:
- build-wrappers
uses: ./.github/workflows/build-packages.yml
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')
uses: ./.github/workflows/build-unity.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
test-unity:
uses: ./.github/workflows/test-unity.yml
name: Test
needs:
- build-unity
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-unity.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-net-framework.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-uwp-managed.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-net-core.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
framework: '["net8.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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-macos.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-ios.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-tvos.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-android.yml
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')
test-woven-classes:
name: Test
needs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-source-generation.yml
test-weaver:
uses: ./.github/workflows/test-weaver.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-weaver.yml
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
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: ./.github/workflows/test-code-coverage.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
cleanup-baas:
uses: ./.github/workflows/cleanup-baas.yml
if: always()
name: Cleanup
needs:
- deploy-baas
- test-code-coverage
if: always()
uses: ./.github/workflows/cleanup-baas.yml
with:
differentiators: '["code-coverage"]'
secrets:
BaaSaasApiKey: ${{ secrets.BAASAAS_API_KEY }}
verify-namespaces:
runs-on: ubuntu-latest
name: Verify Namespaces
needs:
- build-packages
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- name: Fetch Realm.PlatformHelpers
- name: Fetch Realm
uses: actions/download-artifact@v3
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
name: Realm.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm
- name: Fetch Realm.PlatformHelpers
uses: actions/download-artifact@v3
with:
name: Realm.${{ needs.build-packages.outputs.package_version }}
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.UnityUtils
uses: actions/download-artifact@v3
Expand All @@ -197,29 +195,29 @@ jobs:
path: ${{ github.workspace }}/Realm/packages/
- run: dotnet tool install ilspycmd -g --version 8.0.0.7345
- name: Verify Namespaces
run: |
run: |-
$isFailure = $false
Get-ChildItem ./Realm/packages -Filter *.nupkg | Foreach-Object {
$targetPath = Join-Path ./Realm/packages $_.BaseName
Expand-Archive $_.FullName -DestinationPath $targetPath
$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
Get-ChildItem $targetPath -Filter *.dll -Recurse | ForEach-Object {
if (-not ($_.FullName -match "runtimes")) {
$ilspyOutput = ilspycmd $_.FullName
$parentDll = $_.FullName
$parentDll = $_.FullName
$ilspyOutput | ForEach-Object {
if ($_ -match "namespace.*Realm(\.|$)") {
Write-Output "::error file=$parentDll::Realm present in namespace - $($_)"
Set-Variable "isFailure" -Value $true
}
}
$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
exit 1
}
shell: pwsh

0 comments on commit f679464

Please sign in to comment.