Garnet Nightly Tests #687
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: | |
| # ORIGINAL test: [ 'Garnet.test', 'Garnet.test.cluster', 'Tsavorite.test' ] | |
| test: [ 'Garnet.test' ] | |
| # ORIGINAL os: [ ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025 ] | |
| os: [ windows-2022 ] | |
| framework: [ 'net8.0', 'net9.0' ] | |
| # ORIGINAL configuration: [ 'Debug', 'Release' ] | |
| configuration: [ '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 | |
| with: | |
| persist-credentials: true | |
| - 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-24.04' }} | |
| - name: Set environment variable for Linux | |
| run: echo "RunAzureTests=yes" >> $GITHUB_ENV | |
| if: ${{ matrix.os == 'ubuntu-24.04' }} | |
| - name: Set environment variable for Windows | |
| run: echo ("RunAzureTests=yes") >> $env:GITHUB_ENV | |
| if: ${{ matrix.os == 'windows-2025' }} | |
| - 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 | |
| # DEBUG DEBUG - Set to continue-on-error: true for now as it is failing and needs to be addressed at some point | |
| # DEBUG DEBUG - name: Check style format | |
| # DEBUG DEBUG run: dotnet format --verify-no-changes --verbosity diagnostic | |
| # DEBUG DEBUG continue-on-error: true | |
| # DEBUG DEBUG - for perf issuese when debugging, comment out this | |
| # DEBUG DEBUG - name: Build Tsavorite.test | |
| # DEBUG DEBUG if: ${{ matrix.test == 'Tsavorite.test' }} | |
| # DEBUG DEBUG 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 }}" ` | |
| --logger "console;verbosity=detailed" ` | |
| --logger "trx" ` | |
| --results-directory "$resultsDir" | |
| } else { | |
| dotnet test "test/${{ matrix.test }}" -f "${{ matrix.framework }}" ` | |
| --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: | | |
| $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 | |
| $path = Join-Path -Path $base -ChildPath "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| if (-Not (Test-Path $path)) { | |
| Write-Host "No $path found for this matrix combination." | |
| } | |
| if: ${{ always() }} | |
| - name: DEBUG DEBUG Verify allure-results were copied | |
| shell: pwsh | |
| run: | | |
| $dest = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| Write-Host "Contents of ${dest}:" | |
| Get-ChildItem -Path $dest -Recurse | ForEach-Object { Write-Host $_.FullName } | |
| if: ${{ always() }} | |
| - name: Stage allure-results into test/Allure/AllResults | |
| shell: pwsh | |
| run: | | |
| $source = Join-Path $env:GITHUB_WORKSPACE "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results" | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults" | |
| New-Item -ItemType Directory -Path $target -Force | |
| Get-ChildItem -Path $source -Recurse | Copy-Item -Destination $target -Force | |
| if: ${{ always() }} | |
| - 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() }} | |
| generate-allure-report: | |
| name: Generate Allure Report | |
| runs-on: windows-2022 # makes it easy on how calls made so don't have to worry about windows and linux | |
| needs: [ build-test-all ] | |
| if: ${{ always() }} | |
| steps: | |
| - name: Checkout allure_data_history branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: allure_data_history | |
| path: history-branch | |
| persist-credentials: true | |
| - name: DEBUG NOT SURE IF NEEDED IF COPY LATER Copy history from allure_data_history branch into CombinedResults | |
| shell: pwsh | |
| run: | | |
| $source = "${{ github.workspace }}/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" | |
| } | |
| - name: DEBUG DEBUG List contents of test/allure/CombinedResults/history after copying from branch (could be blank if branch is empty) | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/allure/CombinedResults/history" | |
| Get-ChildItem -Path $target -Recurse | |
| if: ${{ always() }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - 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 | |
| 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: DEBUG DEBUG List contents of test/allure/CombinedResults/history BEFORE Copy results | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/allure/CombinedResults/history" | |
| 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: DEBUG DEBUG List contents of test/allure/CombinedResults | |
| shell: pwsh | |
| run: | | |
| $target = Join-Path $env:GITHUB_WORKSPACE "test/allure/CombinedResults" | |
| Get-ChildItem -Path $target -Recurse | |
| if: ${{ always() }} | |
| - name: DEBUG NOT SURE IF NEEDED IF COPY RIGHT AWAY - Copy history from allure_data_history branch into CombinedResults | |
| shell: pwsh | |
| run: | | |
| $source = "${{ github.workspace }}/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" | |
| } | |
| - name: DEBUG DEBUG List contents of test/allure/CombinedResults/history AFTER Copy results | |
| 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() }} | |
| - 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: Echo completion | |
| run: echo Done! |