Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Cache nuget packages (Github actions) #866

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/Generate-TestWorkflows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,19 @@ jobs:
with:
dotnet-version: '$DotNet7SDKVersion'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: `${{ runner.os }}-nuget-`${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
`${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
`$project_name = [System.IO.Path]::GetFileNameWithoutExtension(`$env:project_path)
Expand All @@ -318,11 +331,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}} /p:TestFrameworks=true /p:PortableDebugTypeOnly=true"
- run: dotnet pack `${{env.project_under_test_path}} --configuration `${{matrix.configuration}} --no-restore /p:TestFrameworks=true /p:PortableDebugTypeOnly=true"
}

$fileText += "
- run: dotnet build `${{env.project_path}} --configuration `${{matrix.configuration}} --framework `${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build `${{env.project_path}} --configuration `${{matrix.configuration}} --framework `${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}`" -- RunConfiguration.TargetPlatform=`${{matrix.platform}} TestRunParameters.Parameter\(name=\`"tests:slow\`",\ value=\`"\`${{env.run_slow_tests}}\`"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-AllProjects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -132,7 +145,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-Common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -116,7 +129,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -113,7 +126,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -113,7 +126,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -116,7 +129,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -110,7 +123,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -114,7 +127,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -111,7 +124,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/Lucene-Net-Tests-Benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ jobs:
with:
dotnet-version: '7.0.100'

- name: Cache NuGet Packages
uses: actions/cache@v3
id: lucene-nuget-cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-lucene

- name: Restore dependencies
run: dotnet restore

- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
Expand All @@ -123,7 +136,7 @@ jobs:
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-restore /p:TestFrameworks=true
- 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_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
Expand Down
Loading