From 5d81e8787a4cd263811c632e490494839817823f Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:35:56 +0100 Subject: [PATCH] Fix nuget errors on self-hosted runnners (#3546) * Fix nuget errors on self-hosted runnners * Correction * Corrected condition --- .github/templates/main.yml | 3 +++ .github/templates/test-net-core.yml | 4 ++++ .github/workflows/main.yml | 2 ++ .github/workflows/test-net-core.yml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/templates/main.yml b/.github/templates/main.yml index 71e090cc35..9110d80fc4 100644 --- a/.github/templates/main.yml +++ b/.github/templates/main.yml @@ -77,6 +77,9 @@ jobs: - #@ template.replace(cleanupWorkspace()) - #@ template.replace(checkoutCode()) - #@ template.replace(fetchPackageArtifacts("needs.build-packages.outputs.package_version")) + #! To avoid NU5037 error + - name: Clear nuget cache + run: dotnet nuget locals all --clear - #@ template.replace(dotnetBuildTests("Tests/Benchmarks/PerformanceTests", "net6.0", "linux-x64", "needs.build-packages.outputs.package_version")) - name: Run the tests run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/PerformanceTests -f \"*\" --join" diff --git a/.github/templates/test-net-core.yml b/.github/templates/test-net-core.yml index b7dc72f74d..d516caded5 100644 --- a/.github/templates/test-net-core.yml +++ b/.github/templates/test-net-core.yml @@ -33,6 +33,10 @@ jobs: steps: - #@ template.replace(prepareTest(cleanupWorkspace = True)) + #! To avoid NU5037 error + - name: Clear nuget cache + run: dotnet nuget locals all --clear + if: ${{ matrix.os.runner == 'win81' }} - #@ template.replace(dotnetBuildTests("Tests/Realm.Tests", "${{ matrix.framework }}", "${{ matrix.os.runtime }}")) - name: Run the tests env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80bd8325d6..a4b9d58f00 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -233,6 +233,8 @@ jobs: with: name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Clear nuget cache + run: dotnet nuget locals all --clear - name: Publish Tests/Benchmarks/PerformanceTests run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path diff --git a/.github/workflows/test-net-core.yml b/.github/workflows/test-net-core.yml index 1d48224273..579ad97150 100755 --- a/.github/workflows/test-net-core.yml +++ b/.github/workflows/test-net-core.yml @@ -61,6 +61,9 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Clear nuget cache + run: dotnet nuget locals all --clear + if: ${{ matrix.os.runner == 'win81' }} - name: Publish Tests/Realm.Tests run: dotnet publish Tests/Realm.Tests -c Release -f ${{ matrix.framework }} -r ${{ matrix.os.runtime }} -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path