Skip to content

Commit

Permalink
Always generate a random name for test configs (#2786)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Jan 27, 2022
1 parent d019550 commit cd3d57f
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 62 deletions.
28 changes: 18 additions & 10 deletions .github/templates/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#@ isRelease = "contains(github.head_ref, 'release')"

#@ ignoreSkippedJobsCondition = "always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')"

#@ secret_BaseUrl = "${{ (" + isRelease + " && secrets.REALM_QA_BASE_URL) || secrets.REALM_BASE_URL }}"
#@ secret_AtlasBaseUrl = "${{ (" + isRelease + " && secrets.ATLAS_QA_BASE_URL) || secrets.ATLAS_BASE_URL }}"
#@ secret_AtlasPublicKey = "${{ (" + isRelease + " && secrets.ATLAS_QA_PUBLIC_API_KEY) || secrets.ATLAS_PUBLIC_API_KEY }}"
Expand Down Expand Up @@ -75,6 +77,7 @@ with:
needs:
- build-packages
- #@ baasJobName
if: #@ ignoreSkippedJobsCondition
env:
CLUSTER_NAME: #@ "${{ needs.baas-" + name.replace(".", "").replace(" ", "-").lower() + ".outputs.clusterName }}"
timeout-minutes: #@ testTimeout
Expand Down Expand Up @@ -425,7 +428,12 @@ env:
DOTNET_NOLOGO: true
jobs:
check-wrappers-cache:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu
- windows
runs-on: ${{ matrix.os }}-latest
name: Check wrapper cache
env:
CACHE_SKIP_SAVE: true
Expand All @@ -437,10 +445,13 @@ jobs:
steps:
- #@ template.replace(checkoutCode("recursive", False))
#@ for platform in getWrapperBinaryNames():
- #@ checkCache("wrappers-" + platform, id = "check-cache-" + platform, name = "Check cache for " + platform)
#@ condition = "matrix.os == " + ("'windows'" if platform.find("windows") > -1 else "'ubuntu'")
- _: #@ template.replace(checkCache("wrappers-" + platform, id = "check-cache-" + platform, name = "Check cache for " + platform))
if: #@ condition
- _: #@ template.replace(uploadArtifacts("wrappers-" + platform, "wrappers/build/**", 1))
if: #@ "steps.check-cache-" + platform + ".outputs.cache-hit == 'true'"
if: #@ condition + " && steps.check-cache-" + platform + ".outputs.cache-hit == 'true'"
- run: git clean -fdx
if: #@ condition
#@ end
build-wrappers-macos:
runs-on: macos-latest
Expand Down Expand Up @@ -541,10 +552,7 @@ jobs:
- build-wrappers-android
- build-wrappers-linux
- build-wrappers-windows-uwp
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: #@ ignoreSkippedJobsCondition
outputs:
package_version: ${{ steps.get-version.outputs.version }}
timeout-minutes: #@ wrappersTimeout
Expand Down Expand Up @@ -581,7 +589,7 @@ jobs:
name: Publish package to S3
needs:
- build-packages
if: ${{ github.event_name != 'pull_request' }}
if: #@ ignoreSkippedJobsCondition + " && github.event_name != 'pull_request'"
steps:
- #@ template.replace(checkoutCode(False, False))
- #@ template.replace(fetchPackageArtifacts())
Expand All @@ -593,6 +601,7 @@ jobs:
name: "Test .NET"
needs:
- build-packages
if: #@ ignoreSkippedJobsCondition
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -650,7 +659,7 @@ jobs:
name: Benchmark Linux
needs: build-packages
runs-on: performance-tests
if: ${{ github.event_name == 'push' }}
if: #@ ignoreSkippedJobsCondition + " && github.event_name != 'pull_request'"
timeout-minutes: #@ testTimeout
steps:
- #@ template.replace(cleanupWorkspace())
Expand All @@ -671,4 +680,3 @@ jobs:
dashboard-path: dashboard.charts
nuget-package: ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg
- #@ uploadArtifacts("dashboard.charts", "dashboard.charts", 30)

71 changes: 52 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ env:
DOTNET_NOLOGO: true
jobs:
check-wrappers-cache:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu
- windows
runs-on: ${{ matrix.os }}-latest
name: Check wrapper cache
env:
CACHE_SKIP_SAVE: true
Expand Down Expand Up @@ -39,168 +44,192 @@ jobs:
with:
path: ./wrappers/build/**
key: wrappers-macos-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-macos
uses: actions/upload-artifact@v2
with:
name: wrappers-macos
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-macos.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-macos.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for ios
id: check-cache-ios
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-ios-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-ios
uses: actions/upload-artifact@v2
with:
name: wrappers-ios
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-ios.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-ios.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for linux
id: check-cache-linux
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-linux-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-linux
uses: actions/upload-artifact@v2
with:
name: wrappers-linux
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-linux.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-linux.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for android-armeabi-v7a
id: check-cache-android-armeabi-v7a
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-android-armeabi-v7a-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-android-armeabi-v7a
uses: actions/upload-artifact@v2
with:
name: wrappers-android-armeabi-v7a
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-android-armeabi-v7a.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-android-armeabi-v7a.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for android-arm64-v8a
id: check-cache-android-arm64-v8a
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-android-arm64-v8a-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-android-arm64-v8a
uses: actions/upload-artifact@v2
with:
name: wrappers-android-arm64-v8a
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-android-arm64-v8a.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-android-arm64-v8a.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for android-x86
id: check-cache-android-x86
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-android-x86-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-android-x86
uses: actions/upload-artifact@v2
with:
name: wrappers-android-x86
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-android-x86.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-android-x86.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for android-x86_64
id: check-cache-android-x86_64
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-android-x86_64-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-android-x86_64
uses: actions/upload-artifact@v2
with:
name: wrappers-android-x86_64
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-android-x86_64.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-android-x86_64.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for windows-Win32
id: check-cache-windows-Win32
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-windows-Win32-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'windows'
- name: Store artifacts for wrappers-windows-Win32
uses: actions/upload-artifact@v2
with:
name: wrappers-windows-Win32
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-windows-Win32.outputs.cache-hit == 'true'
if: matrix.os == 'windows' && steps.check-cache-windows-Win32.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'windows'
- name: Check cache for windows-x64
id: check-cache-windows-x64
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-windows-x64-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'windows'
- name: Store artifacts for wrappers-windows-x64
uses: actions/upload-artifact@v2
with:
name: wrappers-windows-x64
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-windows-x64.outputs.cache-hit == 'true'
if: matrix.os == 'windows' && steps.check-cache-windows-x64.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'windows'
- name: Check cache for windows-uwp-Win32
id: check-cache-windows-uwp-Win32
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-windows-uwp-Win32-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'windows'
- name: Store artifacts for wrappers-windows-uwp-Win32
uses: actions/upload-artifact@v2
with:
name: wrappers-windows-uwp-Win32
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-windows-uwp-Win32.outputs.cache-hit == 'true'
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-Win32.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'windows'
- name: Check cache for windows-uwp-x64
id: check-cache-windows-uwp-x64
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-windows-uwp-x64-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'windows'
- name: Store artifacts for wrappers-windows-uwp-x64
uses: actions/upload-artifact@v2
with:
name: wrappers-windows-uwp-x64
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-windows-uwp-x64.outputs.cache-hit == 'true'
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-x64.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'windows'
- name: Check cache for windows-uwp-ARM
id: check-cache-windows-uwp-ARM
uses: nirinchev/cache@d7c96a77c26ab70dd32b202c885cb4b34d95d8a8
with:
path: ./wrappers/build/**
key: wrappers-windows-uwp-ARM-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'windows'
- name: Store artifacts for wrappers-windows-uwp-ARM
uses: actions/upload-artifact@v2
with:
name: wrappers-windows-uwp-ARM
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if: steps.check-cache-windows-uwp-ARM.outputs.cache-hit == 'true'
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-ARM.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'windows'
build-wrappers-macos:
runs-on: macos-latest
name: Wrappers macOS
Expand Down Expand Up @@ -500,10 +529,7 @@ jobs:
- build-wrappers-android
- build-wrappers-linux
- build-wrappers-windows-uwp
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
outputs:
package_version: ${{ steps.get-version.outputs.version }}
timeout-minutes: 90
Expand Down Expand Up @@ -666,7 +692,7 @@ jobs:
name: Publish package to S3
needs:
- build-packages
if: ${{ github.event_name != 'pull_request' }}
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.event_name != 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -727,6 +753,7 @@ jobs:
needs:
- build-packages
- baas-net-framework
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-net-framework.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -815,6 +842,7 @@ jobs:
needs:
- build-packages
- baas-uwp-managed
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-uwp-managed.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -889,6 +917,7 @@ jobs:
name: Test .NET
needs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -975,6 +1004,7 @@ jobs:
needs:
- build-packages
- baas-xamarinmacos
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-xamarinmacos.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -1061,6 +1091,7 @@ jobs:
needs:
- build-packages
- baas-xamarinios
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-xamarinios.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -1152,6 +1183,7 @@ jobs:
needs:
- build-packages
- baas-xamarinandroid
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-xamarinandroid.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -1312,6 +1344,7 @@ jobs:
needs:
- build-packages
- baas-code-coverage
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
env:
CLUSTER_NAME: ${{ needs.baas-code-coverage.outputs.clusterName }}
timeout-minutes: 45
Expand Down Expand Up @@ -1509,7 +1542,7 @@ jobs:
name: Benchmark Linux
needs: build-packages
runs-on: performance-tests
if: ${{ github.event_name == 'push' }}
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- name: Cleanup Workspace
Expand Down
Loading

0 comments on commit cd3d57f

Please sign in to comment.