From 414dc8b90cf6688b140b95cea6cf8adfd8be3812 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 16 Aug 2024 22:49:48 -0400 Subject: [PATCH] Set check back to pending on re-runs --- .github/workflows/ci-pipeline.yml | 50 +++++++++++++------ .../Tgstation.Server.ReleaseNotes/Program.cs | 13 +++++ 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index ab32822e21..ae3b13a9eb 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -769,13 +769,6 @@ jobs: TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt runs-on: windows-latest steps: - - name: Wait for LocalDB Connection # Do this first because we don't want to find out it's failing later - shell: powershell - if: ${{ matrix.database-type == 'SqlServer' }} - run: | - Write-Host "Checking" - sqlcmd -l 600 -S "(localdb)\MSSQLLocalDB" -Q "SELECT @@VERSION;" - - name: Setup dotnet uses: actions/setup-dotnet@v4 with: @@ -785,6 +778,22 @@ jobs: ${{ env.OD_MIN_COMPAT_DOTNET_VERSION }}.0.x dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }} + - name: Retrieve ReleaseNotes Binaries + uses: actions/download-artifact@v4 + with: + name: release_notes_bins + path: release_notes_bins + + - name: Update CI Check Run (Rerun) # Do this here because these are the flakiest tests + run: dotnet release_notes_bins/Tgstation.Server.ReleaseNotes.dll --ci-check ${{ inputs.pull_request_head_sha }}{{ secrets.TGS_CI_GITHUB_APP_TOKEN_BASE64 }} Rerun ${{ github.run_id }} + + - name: Wait for LocalDB Connection # Do this first because we don't want to find out it's failing later + shell: powershell + if: ${{ matrix.database-type == 'SqlServer' }} + run: | + Write-Host "Checking" + sqlcmd -l 600 -S "(localdb)\MSSQLLocalDB" -Q "SELECT @@VERSION;" + - name: Setup Node.JS uses: actions/setup-node@v4 with: @@ -1042,15 +1051,6 @@ jobs: TGS_TELEMETRY_KEY_FILE: /tmp/tgs_telemetry_key.txt runs-on: ubuntu-latest steps: - - name: Disable ptrace_scope - run: echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - - - name: Install Native Dependencies - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 gdb libgcc-s1:i386 libgdiplus - - name: Setup dotnet uses: actions/setup-dotnet@v4 with: @@ -1060,6 +1060,24 @@ jobs: ${{ env.OD_MIN_COMPAT_DOTNET_VERSION }}.0.x dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }} + - name: Retrieve ReleaseNotes Binaries + uses: actions/download-artifact@v4 + with: + name: release_notes_bins + path: release_notes_bins + + - name: Update CI Check Run (Rerun) # Do this here because these are the flakiest tests + run: dotnet release_notes_bins/Tgstation.Server.ReleaseNotes.dll --ci-check ${{ inputs.pull_request_head_sha }}{{ secrets.TGS_CI_GITHUB_APP_TOKEN_BASE64 }} Rerun ${{ github.run_id }} + + - name: Disable ptrace_scope + run: echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + + - name: Install Native Dependencies + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 gdb libgcc-s1:i386 libgdiplus + - name: Setup Node.JS uses: actions/setup-node@v4 with: diff --git a/tools/Tgstation.Server.ReleaseNotes/Program.cs b/tools/Tgstation.Server.ReleaseNotes/Program.cs index b1b83c4a49..ec00f8cf20 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Program.cs +++ b/tools/Tgstation.Server.ReleaseNotes/Program.cs @@ -1679,6 +1679,7 @@ package (version) distribution(s); urgency=urgency { Pending, Started, + Rerun, Cancelled, Success, Failure, @@ -1715,6 +1716,18 @@ package (version) distribution(s); urgency=urgency StartedAt = DateTimeOffset.UtcNow, }); + break; + case CheckMode.Rerun: + var prChecks3 = await gitHubClient.Check.Run.GetAllForReference(RepoOwner, RepoName, ciTargetSha); + var theCheckWeWant3 = prChecks3.CheckRuns.First(x => x.App.Id == AppId); + if(theCheckWeWant3.Status != CheckStatus.InProgress) + { + await gitHubClient.Check.Run.Update(RepoOwner, RepoName, theCheckWeWant3.Id, new CheckRunUpdate + { + Status = CheckStatus.InProgress, + }); + } + break; case CheckMode.Cancelled: case CheckMode.Failure: