You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2025/09/07 21:58:12 UTC

(lucenenet) 03/07: .github/workflows/Generate-TestWorkflows.ps1: Added env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS to the cache key, restore, and build to ensure that all of the test target frameworks are inlcuded in the cache (or we get a separate cache)

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch ci/cache-nuget-packages
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 30a16600d4ab19bcc18f1d595b852b6dbdef6ca1
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Sep 8 04:08:27 2025 +0700

    .github/workflows/Generate-TestWorkflows.ps1: Added env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS to the cache key, restore, and build to ensure that all of the test target frameworks are inlcuded in the cache (or we get a separate cache)
---
 .github/workflows/Generate-TestWorkflows.ps1 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/Generate-TestWorkflows.ps1 b/.github/workflows/Generate-TestWorkflows.ps1
index be262a453..42455c882 100644
--- a/.github/workflows/Generate-TestWorkflows.ps1
+++ b/.github/workflows/Generate-TestWorkflows.ps1
@@ -261,6 +261,7 @@ jobs:
       DOTNET_CLI_TELEMETRY_OPTOUT: 1
       DOTNET_NOLOGO: 1
       NUGET_PACKAGES: `${{ github.workspace }}/.nuget/packages
+      BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS: 'true'
       project_path: '$projectRelativePath'"
     if ($isCLI) {
         $fileText += "
@@ -303,11 +304,11 @@ jobs:
           # '**/*.targets' includes Directory.Build.targets
           # '**/*.sln' and '*.sln' ensure root solution files are included (minimatch glitch for file extension .sln)
           # 'global.json' included for SDK version changes
-          key: nuget-`${{ runner.os }}-`${{ hashFiles('**/*.*proj', '**/*.props', '**/*.targets', '**/*.sln', '*.sln', 'global.json') }}
+          key: nuget-`${{ runner.os }}-`${{ env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS }}-`${{ hashFiles('**/*.*proj', '**/*.props', '**/*.targets', '**/*.sln', '*.sln', 'global.json') }}
           path: `${{ env.NUGET_PACKAGES }}
 
       - name: Restore
-        run: dotnet restore /p:TestFrameworks=true
+        run: dotnet restore /p:TestFrameworks=`${{ env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS }}
 
       - name: Setup Environment Variables
         run: |
@@ -328,11 +329,11 @@ jobs:
     if ($isCLI) {
         # Special case: Generate lucene-cli.nupkg for installation test so the test runner doesn't have to do it
         $fileText += "
-      - run: dotnet pack `${{env.project_under_test_path}} --configuration `${{matrix.configuration}} --no-restore /p:TestFrameworks=true /p:PortableDebugTypeOnly=true"
+      - run: dotnet pack `${{env.project_under_test_path}} --configuration `${{matrix.configuration}} --no-restore /p:TestFrameworks=`${{ env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS }} /p:PortableDebugTypeOnly=true"
     }
 
     $fileText += "
-      - run: dotnet build `${{env.project_path}} --configuration `${{matrix.configuration}} --framework `${{matrix.framework}} --no-restore /p:TestFrameworks=true
+      - run: dotnet build `${{env.project_path}} --configuration `${{matrix.configuration}} --framework `${{matrix.framework}} --no-restore /p:TestFrameworks=`${{ env.BUILD_FOR_ALL_TEST_TARGET_FRAMEWORKS }}
       - run: dotnet test `${{env.project_path}} --configuration `${{matrix.configuration}} --framework `${{matrix.framework}} --no-build --no-restore --blame-hang --blame-hang-dump-type mini --blame-hang-timeout 20minutes --logger:`"console;verbosity=normal`" --logger:`"trx;LogFileName=`${{env.trx_file_name}}`" --logger:`"liquid.md;LogFileName=`${{env.md_file_name}};Title=`${{env.title}};`" --results-directory:`"`${{github.workspace}}/`${{env.test_results_artifact_name}}/`${{env.project_ [...]
         shell: bash
       # upload reports as build artifacts