diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 08a7a1cfc5..e70b298c56 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -41,7 +41,6 @@ env: TGS_TEST_GITHUB_TOKEN: ${{ secrets.LIVE_TESTS_TOKEN }} TGS_RELEASE_NOTES_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }} PACKAGING_PRIVATE_KEY_PASSPHRASE: ${{ secrets.PACKAGING_PRIVATE_KEY_PASSPHRASE }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} concurrency: group: "ci-${{ (github.event_name != 'push' && github.event_name != 'schedule' && github.event.inputs.pull_request_number) || github.run_id }}-${{ github.event_name }}" @@ -967,7 +966,7 @@ jobs: upload-code-coverage: name: Upload Code Coverage - needs: [ linux-unit-tests, linux-integration-tests, windows-unit-tests, windows-integration-tests ] + needs: [ linux-unit-tests, linux-integration-tests, windows-unit-tests, windows-integration-tests, build-releasenotes ] runs-on: ubuntu-latest steps: - name: Checkout (Branch) @@ -1214,11 +1213,23 @@ jobs: name: windows-integration-test-coverage-Release-Advanced-Sqlite path: ./code_coverage/integration_tests/windows_integration_tests_release_system_sqlite + - name: Retrieve ReleaseNotes Binaries + uses: actions/download-artifact@v4 + with: + name: release_notes_bins + path: release_notes_bins + - name: Upload Coverage to CodeCov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: directory: ./code_coverage fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + handle_no_reports_found: true + + - name: Wait for CodeCov Status + run: dotnet release_notes_bins/Tgstation.Server.ReleaseNotes --wait-codecov ${{ github.run_id }} build-deb: name: Build .deb Package # Can't do i386 due to https://github.com/dotnet/core/issues/4595 diff --git a/.github/workflows/scripts/rerunFlakyTests.js b/.github/workflows/scripts/rerunFlakyTests.js index d191983878..7dda0f389a 100644 --- a/.github/workflows/scripts/rerunFlakyTests.js +++ b/.github/workflows/scripts/rerunFlakyTests.js @@ -3,7 +3,8 @@ const CONSIDERED_JOBS = [ "Windows Live Tests", "Linux Live Tests", - "Build .deb Package" + "Build .deb Package", + "Upload Code Coverage" ]; async function getFailedJobsForRun(github, context, workflowRunId, runAttempt) { diff --git a/tools/Tgstation.Server.ReleaseNotes/Program.cs b/tools/Tgstation.Server.ReleaseNotes/Program.cs index 46c887fd5f..c59f86fd19 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Program.cs +++ b/tools/Tgstation.Server.ReleaseNotes/Program.cs @@ -60,6 +60,7 @@ namespace Tgstation.Server.ReleaseNotes var fullNotes = versionString.Equals("--generate-full-notes", StringComparison.OrdinalIgnoreCase); var nuget = versionString.Equals("--nuget", StringComparison.OrdinalIgnoreCase); var genToken = versionString.Equals("--token-output-file", StringComparison.OrdinalIgnoreCase); + var waitCodecov = versionString.Equals("--wait-codecov", StringComparison.OrdinalIgnoreCase); if ((!Version.TryParse(versionString, out var version) || version.Revision != -1) && !ensureRelease @@ -67,7 +68,8 @@ namespace Tgstation.Server.ReleaseNotes && !shaCheck && !fullNotes && !nuget - && !genToken) + && !genToken + && !waitCodecov) { Console.WriteLine("Invalid version: " + versionString); return 2; @@ -155,6 +157,11 @@ namespace Tgstation.Server.ReleaseNotes client.Credentials = new Credentials(githubToken); } + if (waitCodecov) + { + return await CodecovCheck(client, Int64.Parse(args[1])); + } + if (linkWinget) { if (args.Length < 2 || !Uri.TryCreate(args[1], new UriCreationOptions(), out var actionsUrl)) @@ -1671,5 +1678,21 @@ package (version) distribution(s); urgency=urgency else Debug.Assert(condition); } + + static async ValueTask CodecovCheck(IGitHubClient client, long runId) + { + var currentRun = await client.Actions.Workflows.Runs.Get(RepoOwner, RepoName, runId); + + bool foundRun = false; + for(int i = 0; i < 15 && !foundRun; ++i) + { + var allRuns = await client.Check.Run.GetAllForReference(RepoOwner, RepoName, currentRun.HeadSha); + foundRun = allRuns.CheckRuns.Any(x => x.CheckSuite.Id == currentRun.Id && x.Name == "codecov/project"); + if (!foundRun && i != 14) + await Task.Delay(TimeSpan.FromMinutes(1)); + } + + return foundRun ? 0 : 24398; + } } }