11# @ load("@ytt:template", "template")
22# @ load("@ytt:overlay", "overlay")
3- # @ load("common.lib.yml", "configuration", "nugetPackages", "checkoutCode", "setupVcpkg")
3+ # @ load("common.lib.yml", "configuration", "nugetPackages", "checkoutCode", "setupVcpkg", "actionCache", "actionUploadArtifact", "actionDownloadArtifact", "actionSetupMSBuild", "actionSetupDotnet", "actionRuniOSSimulator", "actionDockerLayerCaching", "actionDockerBuild", "actionDockerRun", "actionCoveralls", "actionDeleteArtifact" )
44
55# @ androidABIs = [ 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' ]
66# @ windowsArchs = [ 'Win32', 'x64' ]
77# @ windowsUWPArchs = [ 'Win32', 'x64', 'ARM' ]
88# @ wrappersCacheCondition = "steps.check-cache.outputs.cache-hit != 'true'"
99# @ dotnetRuntime = "${{ (runner.os == 'macOS' && 'osx-x64') || (runner.os == 'Windows' && 'win-x64') || (runner.os == 'Linux' && 'linux-x64') || '???' }}"
1010
11- # @ def checkCache(key):
11+ # @ def getWrapperBuildCommand(cmd):
12+ # @ configurationParam = " --configuration=" + configuration
13+ # @ ltoParam = " -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${{ github.event_name != 'pull_request' && 'ON' || 'OFF' }}"
14+ # @ if cmd.startswith("powershell"):
15+ # @ configurationParam = " -Configuration " + configuration
16+ # @ ltoParam = "${{ github.event_name != 'pull_request' && ' -EnableLTO' || '' }}"
17+ # @ end
18+ # @ return cmd + configurationParam + ltoParam
19+ # @ end
20+
21+ # @ def checkCache(outputVar):
22+ # @ key = outputVar + "-" + configuration + "-${{ github.event_name != 'pull_request' && 'ON' || 'OFF' }}-${{hashFiles('./wrappers/**')}}"
1223name : Check cache
1324id : check-cache
14- uses : actions/cache@v2
25+ uses : # @ actionCache
1526with :
1627 path : ./wrappers/build/**
1728 key : # @ key
1829# @ end
1930
20- # @ def buildWrappers(cmd, outputVar, intermediateSteps = []):
21- # @ configurationParam = " --configuration=" + configuration
22- # @ ltoParam = " -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${{ github.event_name != 'pull_request' && 'ON' || 'OFF' }}"
23- # @ if cmd.startswith("powershell"):
24- # @ configurationParam = " -Configuration " + configuration
25- # @ ltoParam = "${{ github.event_name != 'pull_request' && ' -EnableLTO' || '' }}"
31+ # @ def storeWrapperBinaries(outputVar):
32+ name : Store artifacts
33+ uses : # @ actionUploadArtifact
34+ with :
35+ name : # @ outputVar
36+ path : wrappers/build/**
37+ retention-days : 1
2638# @ end
27- # @ cacheKey = outputVar + "-" + configuration + "-${{ github.event_name != 'pull_request' && 'ON' || 'OFF' }}-${{hashFiles('./wrappers/**')}}"
28- # @ actualCommand = cmd + configurationParam + ltoParam
2939
40+ # @ def buildWrappers(cmd, outputVar, intermediateSteps = []):
3041steps :
3142 - # @ template.replace(checkoutCode("recursive"))
32- - # @ checkCache(cacheKey )
43+ - # @ checkCache(outputVar )
3344 # @ for step in intermediateSteps:
3445 - # @ template.replace(step)
3546 # @ end
3647 - name : Build wrappers
37- run : # @ actualCommand
48+ run : # @ getWrapperBuildCommand(cmd)
3849 if : # @ wrappersCacheCondition
39- - name : Store artifacts
40- uses : actions/upload-artifact@v2
41- with :
42- name : # @ outputVar
43- path : wrappers/build/**
44- retention-days : 1
50+ - # @ storeWrapperBinaries(outputVar)
4551# @ end
4652
4753# @ def setupWin81SDK():
6268
6369# @ def msbuildOnWin(projectPath, **properties):
6470 - name : Add msbuild to PATH
65- uses : microsoft/setup-msbuild@v1.0.2
71+ uses : # @ actionSetupMSBuild
6672 - # @ msbuild(projectPath, RestoreConfigFile="Tests/Test.NuGet.Config", UseRealmNupkgsWithVersion="${{ needs.build-packages.outputs.package_version }}", **properties)
6773# @ end
6874
7177 - name : # @ "Build Unity"
7278 run : # @ "dotnet run --project Tools/SetupUnityPackage/ -- realm --packages-path Realm/packages --pack"
7379 - name : Store Unity artifacts
74- uses : actions/upload-artifact@v2
80+ uses : # @ actionUploadArtifact
7581 with :
7682 name : # @ finalPkgName
7783 path : # @ "${{ github.workspace }}/Realm/Realm.Unity/" + finalPkgName
8490 - name : Check Docfx cache
8591 id : check-docfx-cache
8692 if : # @ docsCondition
87- uses : actions/cache@v2
93+ uses : # @ actionCache
8894 with :
8995 path : ' C:\docfx'
9096 key : docfx
@@ -101,7 +107,7 @@ steps:
101107 Compress-Archive -Path Docs/_site -DestinationPath "Realm/packages/Docs.zip"
102108 - name : Store docs artifacts
103109 if : # @ docsCondition
104- uses : actions/upload-artifact@v2
110+ uses : # @ actionUploadArtifact
105111 with :
106112 name : Docs.zip
107113 path : ${{ github.workspace }}/Realm/packages/Docs.zip
@@ -112,7 +118,7 @@ steps:
112118# @ for pkgName in [ 'Realm.Fody', 'Realm' ]:
113119# @ finalPkgName = pkgName + ".${{ steps.find-nupkg-version.outputs.package_version }}"
114120 - name : # @ "Store artifacts for " + pkgName
115- uses : actions/upload-artifact@v2
121+ uses : # @ actionUploadArtifact
116122 with :
117123 name : # @ finalPkgName
118124 path : # @ "${{ github.workspace }}/Realm/packages/" + finalPkgName + ".*nupkg"
@@ -123,7 +129,7 @@ steps:
123129# @ def fetchPackageArtifacts():
124130# @ for pkg in [ "Realm", "Realm.Fody" ]:
125131 - name : # @ "Fetch " + pkg
126- uses : actions/download-artifact@v2
132+ uses : # @ actionDownloadArtifact
127133 with :
128134 name : # @ pkg + ".${{ needs.build-packages.outputs.package_version }}"
129135 path : ${{ github.workspace }}/Realm/packages/
@@ -148,7 +154,7 @@ steps:
148154# @ def fetchWrapperBinaries():
149155# @ for platform in getWrapperBinaryNames():
150156 - name : # @ "Fetch artifacts for " + platform
151- uses : actions/download-artifact@v2
157+ uses : # @ actionDownloadArtifact
152158 with :
153159 name : # @ "wrappers-" + platform
154160 path : wrappers/build
@@ -240,9 +246,30 @@ jobs:
240246 name : Wrappers iOS
241247 _ : # @ template.replace(buildWrappers("./wrappers/build-ios.sh", "wrappers-ios"))
242248 build-wrappers-linux :
243- runs-on : ubuntu-20.04
249+ runs-on : ubuntu-latest
244250 name : Wrappers Linux
245- _ : # @ template.replace(buildWrappers("./wrappers/build.sh", "wrappers-linux"))
251+ steps :
252+ - # @ template.replace(checkoutCode("recursive"))
253+ - # @ checkCache("wrappers-linux")
254+ - uses : # @ actionDockerLayerCaching
255+ continue-on-error : true
256+ if : # @ wrappersCacheCondition
257+ - name : Build CentOS image
258+ uses : # @ actionDockerBuild
259+ with :
260+ tags : wrappers-centos:latest
261+ file : ./wrappers/centos.Dockerfile
262+ push : false
263+ if : # @ wrappersCacheCondition
264+ - name : Build wrappers
265+ uses : # @ actionDockerRun
266+ with :
267+ image : wrappers-centos:latest
268+ shell : bash
269+ options : -v ${{ github.workspace }}:/work
270+ run : # @ getWrapperBuildCommand("/work/wrappers/build.sh")
271+ if : # @ wrappersCacheCondition
272+ - # @ storeWrapperBinaries("wrappers-linux")
246273 build-wrappers-android :
247274 runs-on : ubuntu-20.04
248275 name : Wrappers Android
@@ -278,7 +305,7 @@ jobs:
278305 package_version : ${{ steps.find-nupkg-version.outputs.package_version }}
279306 steps :
280307 - name : Add msbuild to PATH
281- uses : microsoft/setup-msbuild@v1.0.2
308+ uses : # @ actionSetupMSBuild
282309 - # @ template.replace(checkoutCode())
283310 - name : Set version suffix
284311 id : set-version-suffix
@@ -367,7 +394,7 @@ jobs:
367394 steps :
368395 - # @ template.replace(checkoutCode())
369396 - # @ template.replace(fetchPackageArtifacts())
370- - uses : actions/setup-dotnet@v1
397+ - uses : # @ actionSetupDotnet
371398 if : matrix.targetFramework == 'net6.0'
372399 with :
373400 dotnet-version : ' 6.0.x'
@@ -394,7 +421,7 @@ jobs:
394421 - # @ template.replace(fetchPackageArtifacts())
395422 - # @ msbuild("Tests/Tests.iOS", TargetFrameworkVersion="v1.0", Platform="iPhoneSimulator", RestoreConfigFile="Tests/Test.NuGet.Config", UseRealmNupkgsWithVersion="${{ needs.build-packages.outputs.package_version }}")
396423 - name : Run the tests
397- uses : realm/ci-actions/run-ios-simulator@v1
424+ uses : # @ actionRuniOSSimulator
398425 with :
399426 appPath : ' Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app'
400427 bundleId : ' io.realm.dotnettests'
@@ -417,7 +444,7 @@ jobs:
417444 steps :
418445 - # @ template.replace(checkoutCode())
419446 - # @ template.replace(fetchWrapperBinaries())
420- - uses : actions/setup-dotnet@v1
447+ - uses : # @ actionSetupDotnet
421448 with :
422449 dotnet-version : ' 5.0.x'
423450 - name : Setup Coverlet & Report Generator
@@ -428,7 +455,7 @@ jobs:
428455 - # @ template.replace(dotnetPublishAndRunCoverage("net5.0"))
429456 - name : Publish Coverage
430457 id : publish-coveralls
431- uses : coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # ! v1.1.3
458+ uses : # @ actionCoveralls
432459 with :
433460 github-token : ${{ secrets.GITHUB_TOKEN }}
434461 path-to-lcov : ./report.lcov
@@ -443,7 +470,7 @@ jobs:
443470 steps :
444471# @ for platform in getWrapperBinaryNames():
445472 - name : # @ "Delete artifacts for " + platform
446- uses : geekyeggo/delete-artifact@56e063d7d8bf9972ac54aca4454d3a6675917f44 # ! v1
473+ uses : # @ actionDeleteArtifact
447474 with :
448475 name : # @ "wrappers-" + platform
449476# @ end
@@ -470,7 +497,7 @@ jobs:
470497 dashboard-path : dashboard.charts
471498 nuget-package : ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg
472499 - name : Upload Charts Dashboard File
473- uses : actions/upload-artifact@v2
500+ uses : # @ actionUploadArtifact
474501 with :
475502 name : dashboard.charts
476503 path : ${{ github.workspace }}/dashboard.charts
0 commit comments