Garnet Nightly Tests #753
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Garnet Nightly Tests | |
| on: | |
| schedule: | |
| - cron: '0 9 * * *' # Runs at 09:00 UTC, which is 1:00 AM PST | |
| workflow_dispatch: | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-test-all: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: [ 'Garnet.test', 'Garnet.test.cluster', 'Tsavorite.test' ] | |
| os: [ ubuntu-latest, windows-latest ] | |
| framework: [ 'net8.0', 'net9.0' ] | |
| configuration: [ 'Debug', 'Release' ] | |
| steps: | |
| - name: Install Allure CLI | |
| shell: pwsh | |
| run: | | |
| if ($env:RUNNER_OS -eq "Windows") { | |
| Set-ExecutionPolicy RemoteSigned -Scope Process -Force | |
| iwr -useb get.scoop.sh | iex | |
| scoop install allure | |
| $shimPath = "$env:USERPROFILE\scoop\shims" | |
| echo "Adding Scoop shims to PATH: $shimPath" | |
| echo "$shimPath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH | |
| } elseif ($env:RUNNER_OS -eq "Linux") { | |
| npm install -g allure-commandline --save-dev | |
| } else { | |
| Write-Host "Unsupported OS: $env:RUNNER_OS" | |
| exit 1 | |
| } | |
| - name: DEBUG DEBUG Verify Allure installation | |
| run: allure --version | |
| shell: pwsh | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set workaround for libaio on Ubuntu 24.04 (see https://askubuntu.com/questions/1512196/libaio1-on-noble/1512197#1512197) | |
| run: | | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| - name: Set environment variable for Linux | |
| run: echo "RunAzureTests=yes" >> $GITHUB_ENV | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| - name: Set environment variable for Windows | |
| run: echo ("RunAzureTests=yes") >> $env:GITHUB_ENV | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Setup Node.js for Azurite | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install and Run Azurite | |
| shell: bash | |
| run: | | |
| npm install -g azurite | |
| azurite & | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Check style format | |
| run: dotnet format --verify-no-changes --verbosity diagnostic | |
| - name: Build Tsavorite.test | |
| if: ${{ matrix.test == 'Tsavorite.test' }} | |
| run: dotnet build libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj --configuration ${{ matrix.configuration }} | |
| - name: Build Garnet | |
| if: ${{ matrix.test != 'Tsavorite.test' }} | |
| run: dotnet build --configuration ${{ matrix.configuration }} | |
| - name: Run tests ${{ matrix.test }} | |
| shell: pwsh | |
| run: | | |
| $resultsDir = "${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}" | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| dotnet test "libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj" ` | |
| -f "${{ matrix.framework }}" ` | |
| --configuration "${{ matrix.configuration }}" ` | |
| --logger "console;verbosity=detailed" ` | |
| --logger "trx" ` | |
| --results-directory "$resultsDir" | |
| } else { | |
| dotnet test "test/${{ matrix.test }}" ` | |
| -f "${{ matrix.framework }}" ` | |
| --configuration "${{ matrix.configuration }}" ` | |
| --logger "console;verbosity=detailed" ` | |
| --logger "trx" ` | |
| --results-directory "$resultsDir" | |
| } | |
| timeout-minutes: 55 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }} | |
| path: ${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }} | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG path existence using matrix variables | |
| shell: pwsh | |
| run: | | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| $source = "${{ github.workspace }}/libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } else { | |
| $source = "${{ github.workspace }}/test/Allure/TestData/${{ matrix.framework }}/allure-results" | |
| } | |
| Write-Host "Checking source path: $source" | |
| if (Test-Path $source) { | |
| Write-Host "Source path exists." | |
| } else { | |
| Write-Host "Source path does NOT exist." | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Check if allure-results exists | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| $path = Join-Path $base "libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } else { | |
| $path = Join-Path $base "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } | |
| Write-Host "Checking path: $path" | |
| if (Test-Path $path) { | |
| Write-Host "Found allure-results for this matrix combination." | |
| } else { | |
| Write-Host "No allure-results found at $path for this matrix combination." | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Verify allure-results were copied | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| $dest = Join-Path $base "libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } else { | |
| $dest = Join-Path $base "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } | |
| Write-Host "Contents of ${dest}:" | |
| if (Test-Path $dest) { | |
| Get-ChildItem -Path $dest -Recurse | ForEach-Object { Write-Host $_.FullName } | |
| } else { | |
| Write-Host "No allure-results found at ${dest}" | |
| } | |
| if: ${{ always() }} | |
| - name: Stage allure-results into test/Allure/AllResults | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| $source = Join-Path $base "libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } else { | |
| $source = Join-Path $base "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } | |
| $target = Join-Path $base "test/Allure/AllResults" | |
| Write-Host "Staging allure-results from $source into $target" | |
| New-Item -ItemType Directory -Path $target -Force | Out-Null | |
| if (Test-Path $source) { | |
| Get-ChildItem -Path $source -Recurse | Copy-Item -Destination $target -Force | |
| Write-Host "Copied allure-results into $target" | |
| } else { | |
| Write-Host "Source path $source not found, skipping copy" | |
| } | |
| if: ${{ always() }} | |
| # NOTE - need this to get the results names properly categorized in Allure report at Suite level - problem is that it can hit a max limit in the system if do a bug test matrix | |
| - name: Upload Allure Results to artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AllureResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}-${{ matrix.test }} | |
| path: test/Allure/AllResults | |
| if: ${{ always() }} | |
| - name: Clean up raw allure-results folders after copying to Allure staging area | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| $paths = @( | |
| "libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results", | |
| "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| ) | |
| foreach ($p in $paths) { | |
| $full = Join-Path $base $p | |
| if (Test-Path $full) { | |
| Write-Host "Removing $full" | |
| Remove-Item $full -Recurse -Force | |
| } | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Verify allure-results were deleted by showing contents of folder | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| if ("${{ matrix.test }}" -eq "Tsavorite.test") { | |
| $dest = Join-Path $base "libs/storage/Tsavorite/cs/test/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } else { | |
| $dest = Join-Path $base "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| } | |
| Write-Host "Contents of ${dest}:" | |
| if (Test-Path $dest) { | |
| Get-ChildItem -Path $dest -Recurse | ForEach-Object { Write-Host $_.FullName } | |
| } else { | |
| Write-Host "No allure-results found at ${dest}" | |
| } | |
| if: ${{ always() }} | |
| generate-allure-report: | |
| name: Generate Allure Report | |
| runs-on: windows-latest # only used to generate report - makes it easy on how calls made so don't have to worry about windows and linux | |
| needs: [ build-test-all ] | |
| if: ${{ always() }} | |
| steps: | |
| # First checkout the main repo into the default workspace root | |
| - name: Checkout main repository | |
| uses: actions/checkout@v4 | |
| # Then checkout the allure_data_history branch into a subfolder | |
| - name: Checkout allure_data_history branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: allure_data_history | |
| path: history-branch | |
| persist-credentials: true | |
| - name: DEBUG DEBUG List files in history-branch root after check out | |
| shell: pwsh | |
| run: | | |
| Get-ChildItem -Recurse -Path "${{ github.workspace }}/history-branch" | |
| if: ${{ always() }} | |
| - name: Install Allure CLI | |
| shell: pwsh | |
| run: | | |
| if ($env:RUNNER_OS -eq "Windows") { | |
| Set-ExecutionPolicy RemoteSigned -Scope Process -Force | |
| iwr -useb get.scoop.sh | iex | |
| scoop install allure | |
| $shimPath = "$env:USERPROFILE\scoop\shims" | |
| echo "Adding Scoop shims to PATH: $shimPath" | |
| echo "$shimPath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH | |
| } elseif ($env:RUNNER_OS -eq "Linux") { | |
| npm install -g allure-commandline --save-dev | |
| } else { | |
| Write-Host "Unsupported OS: $env:RUNNER_OS" | |
| exit 1 | |
| } | |
| if: ${{ always() }} | |
| - name: Download all test result artifacts that were staged in artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test/Allure/AllResults | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Show working directory and contents | |
| shell: pwsh | |
| run: | | |
| $cwd = Get-Location | |
| Write-Host "Current directory: $cwd" | |
| Get-ChildItem -Force | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Check if GenerateAllureReport.ps1 exists | |
| shell: pwsh | |
| run: | | |
| $scriptPath = Join-Path $env:GITHUB_WORKSPACE "test/Allure/GenerateAllureReport.ps1" | |
| if (Test-Path $scriptPath) { | |
| Write-Host "Script found at $scriptPath" | |
| } else { | |
| Write-Host "Script NOT found at $scriptPath" | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG List contents of test/Allure/AllResults | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults" | |
| Get-ChildItem -Path $target -Recurse | |
| if: ${{ always() }} | |
| - name: Copy all results into one folder (CombinedResults) | |
| shell: pwsh | |
| run: | | |
| $source = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults" | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/CombinedResults" | |
| New-Item -ItemType Directory -Path $target -Force | |
| Get-ChildItem -Path $source -Recurse -File | ForEach-Object { | |
| Copy-Item -Path $_.FullName -Destination $target -Force | |
| } | |
| if: ${{ always() }} | |
| - name: Final cleanup of stray allure-results folders | |
| shell: pwsh | |
| run: | | |
| $base = $env:GITHUB_WORKSPACE | |
| # Remove any allure-results directories anywhere under workspace | |
| Get-ChildItem -Path $base -Recurse -Directory -Filter "allure-results" | | |
| ForEach-Object { | |
| Write-Host "Removing $($_.FullName)" | |
| Remove-Item $_.FullName -Recurse -Force | |
| } | |
| # Remove the staging folder once CombinedResults is ready | |
| $staging = Join-Path $base "test/Allure/AllResults" | |
| if (Test-Path $staging) { | |
| Write-Host "Removing staging folder $staging" | |
| Remove-Item $staging -Recurse -Force | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG - maybe don't need - Clean up AllResults after staging into CombinedResults | |
| shell: pwsh | |
| run: | | |
| $source = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults" | |
| if (Test-Path $source) { | |
| Write-Host "Removing $source" | |
| Remove-Item $source -Recurse -Force | |
| } else { | |
| Write-Host "No AllResults folder found to remove" | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG List contents of test/Allure/AllResults (after deleted just to check) | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults" | |
| Get-ChildItem -Path $target -Recurse | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG List contents of test/Allure/CombinedResults BEFORE Copy previous history | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/CombinedResults" | |
| Write-Host "=== CombinedResults ===" | |
| Get-ChildItem -Path $target -Recurse | |
| $history = Join-Path $target "history" | |
| if (Test-Path $history) { | |
| Write-Host "=== CombinedResults/history ===" | |
| Get-ChildItem -Path $history -Recurse | |
| } else { | |
| Write-Host "No history folder found in CombinedResults" | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG List files in history-branch | |
| shell: pwsh | |
| run: | | |
| $path = "${{ github.workspace }}/history-branch" | |
| Write-Host "=== Listing contents of history-branch ===" | |
| Get-ChildItem -Recurse -Path $path | |
| # DEBUG DEBUG - commenting this out so can test other parts to make sure getting history isn't the cause of problems | |
| #- name: Copy history from allure_data_history branch into CombinedResults | |
| #shell: pwsh | |
| #run: | | |
| #$source = "${{ github.workspace }}/history-branch/test/Allure/history" | |
| #$target = "${{ github.workspace }}/test/Allure/CombinedResults/history" | |
| #if (Test-Path $source) { | |
| #New-Item -ItemType Directory -Path $target -Force | |
| #Copy-Item -Path (Join-Path $source '*') -Destination $target -Recurse -Force | |
| #Write-Host "History copied from allure_data_history into CombinedResults" | |
| #} else { | |
| #Write-Host "No history found in allure_data_history, starting fresh" | |
| #} | |
| #if: ${{ always() }} | |
| - name: DEBUG DEBUG List contents of test/Allure/CombinedResults/history AFTER Copy previous history | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/CombinedResults/history" | |
| Get-ChildItem -Path $target -Recurse | |
| if: ${{ always() }} | |
| - name: Run GenerateAllureReport.ps1 | |
| shell: pwsh | |
| run: | | |
| Set-Location "${{ github.workspace }}/test/Allure" | |
| .\GenerateAllureReport.ps1 | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Upload Allure history to artifacts so can use for debugging | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-history | |
| path: test/Allure/allure-report/history | |
| if: ${{ always() }} | |
| # DEBUG DEBUG - Commenting this out for now to test other parts | |
| #- name: Commit updated history to allure_data_history | |
| # shell: pwsh | |
| # run: | | |
| # git config --global user.name "github-actions[bot]" | |
| # git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # git fetch origin allure_data_history | |
| # git checkout allure_data_history | |
| # $source = "${{ github.workspace }}/test/Allure/allure-report/history" | |
| # $target = "${{ github.workspace }}/test/Allure/history" | |
| # Remove-Item -Recurse -Force $target -ErrorAction SilentlyContinue | |
| # Copy-Item -Path $source -Destination $target -Recurse -Force | |
| # git add test/Allure/history | |
| # git commit -m "Update Allure history [CI]" | |
| # git push origin allure_data_history | |
| # if: ${{ always() }} | |
| - name: Upload Allure HTML report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-report | |
| path: test/Allure/allure-report | |
| if: ${{ always() }} | |
| - name: Publish Allure report to GH Web site | |
| shell: pwsh | |
| run: | | |
| $source = Join-Path $env:GITHUB_WORKSPACE "test/Allure/allure-report" | |
| $target = Join-Path $env:GITHUB_WORKSPACE "website/static/allure" | |
| Write-Host "Copying Allure report from $source to $target" | |
| New-Item -ItemType Directory -Path $target -Force | Out-Null | |
| Copy-Item -Path (Join-Path $source '*') -Destination $target -Recurse -Force | |
| Write-Host "Allure report staged in website/static/allure" | |
| - name: DEBUG DEBUG List contents of website/static to make sure Allure report copied | |
| shell: pwsh | |
| run: | | |
| $static = Join-Path $env:GITHUB_WORKSPACE "website/static" | |
| Write-Host "=== Listing contents of website/static ===" | |
| Get-ChildItem -Path $static -Recurse | |
| if: ${{ always() }} | |
| - name: Echo completion | |
| run: echo Done! |