From 9b557a3b40fddb6a07b07bd02aeb47ce72905397 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 19 Dec 2019 03:18:54 +0100 Subject: [PATCH 01/10] (GH-95) Added support for .net core 3.0 in .NET Core Tool fixes #95 --- .travis.yml | 2 +- Source/Codecov.Tests/Codecov.Tests.csproj | 2 +- Source/Codecov.Tool/Codecov.Tool.csproj | 2 +- Source/Codecov/Codecov.csproj | 2 +- appveyor.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e89f65b..59042a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ os: - linux - osx mono: latest -dotnet: 2.1.603 +dotnet: 3.0.100 cache: directories: diff --git a/Source/Codecov.Tests/Codecov.Tests.csproj b/Source/Codecov.Tests/Codecov.Tests.csproj index c435e65..1a2f72a 100644 --- a/Source/Codecov.Tests/Codecov.Tests.csproj +++ b/Source/Codecov.Tests/Codecov.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 diff --git a/Source/Codecov.Tool/Codecov.Tool.csproj b/Source/Codecov.Tool/Codecov.Tool.csproj index b074980..dc5b159 100644 --- a/Source/Codecov.Tool/Codecov.Tool.csproj +++ b/Source/Codecov.Tool/Codecov.Tool.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 .\Codecov.ruleset Codecov.Tool codecov diff --git a/Source/Codecov/Codecov.csproj b/Source/Codecov/Codecov.csproj index 46ef27c..ba4bb37 100644 --- a/Source/Codecov/Codecov.csproj +++ b/Source/Codecov/Codecov.csproj @@ -1,5 +1,5 @@  - + netcoreapp2.1 win7-x64;linux-x64;osx-x64 diff --git a/appveyor.yml b/appveyor.yml index b4f4a46..d2c791e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ image: - Ubuntu - - Visual Studio 2017 + - Visual Studio 2019 pull_requests: do_not_increment_build_number: true From 5ee6a93a283e37dbfd81260760bc68ae29e7b215 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 09:28:50 +0100 Subject: [PATCH 02/10] (GH-97) Warn user if total file sizes is above 20MB fixes #97 --- Source/Codecov/Program/UploadFacade.cs | 9 +++++++++ Source/Codecov/Utilities/FileSystem.cs | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/Source/Codecov/Program/UploadFacade.cs b/Source/Codecov/Program/UploadFacade.cs index 56bbf90..d8c0bde 100644 --- a/Source/Codecov/Program/UploadFacade.cs +++ b/Source/Codecov/Program/UploadFacade.cs @@ -14,6 +14,7 @@ using Codecov.Terminal; using Codecov.Upload; using Codecov.Url; +using Codecov.Utilities; using Codecov.Yaml; namespace Codecov.Program @@ -112,6 +113,14 @@ public void Uploader() return; } + // We warn if the total file size is above 20 MB + var fileSizes = Coverage.CoverageReports.Sum(x => FileSystem.GetFileSize(x.File)); + if (fileSizes > 20_971_520) + { + Log.Warning($"Total file size of reports is above 20MB, this may prevent report being shown on {Url.GetUrl.Host}"); + Log.Warning("Reduce the total upload size if this occurs"); + } + Log.Information("Uploading Reports."); Log.Information($"url: {Url.GetUrl.Scheme}://{Url.GetUrl.Authority}"); Log.Verboase($"api endpoint: {Url.GetUrl}"); diff --git a/Source/Codecov/Utilities/FileSystem.cs b/Source/Codecov/Utilities/FileSystem.cs index 9d43e62..70a00cb 100644 --- a/Source/Codecov/Utilities/FileSystem.cs +++ b/Source/Codecov/Utilities/FileSystem.cs @@ -5,6 +5,12 @@ namespace Codecov.Utilities { internal static class FileSystem { + internal static long GetFileSize(string path) + { + var fileInfo = new FileInfo(path); + return fileInfo.Exists ? fileInfo.Length : 0; + } + internal static string NormalizedPath(string path) { if (string.IsNullOrWhiteSpace(path)) From d40a9b233e82c33ea19ac9567ccbd31511c72753 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 09:30:24 +0100 Subject: [PATCH 03/10] (maint) Update glob dependency to 1.1.5 --- Source/Codecov/Codecov.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Codecov/Codecov.csproj b/Source/Codecov/Codecov.csproj index ba4bb37..cf93c43 100644 --- a/Source/Codecov/Codecov.csproj +++ b/Source/Codecov/Codecov.csproj @@ -26,7 +26,7 @@ - + From 50bd3a3330283425326389dcdbcccde70b368714 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 09:30:59 +0100 Subject: [PATCH 04/10] (maint) Update CommandLineParser dependency to 2.7.82 --- Source/Codecov/Codecov.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Codecov/Codecov.csproj b/Source/Codecov/Codecov.csproj index cf93c43..f109f81 100644 --- a/Source/Codecov/Codecov.csproj +++ b/Source/Codecov/Codecov.csproj @@ -25,7 +25,7 @@ - + From 5d048ab4cbb5ebaf44d4aef7494b61146f55306f Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 09:32:42 +0100 Subject: [PATCH 05/10] (maint) Update unit tests dependencies to latest --- Source/Codecov.Tests/Codecov.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Codecov.Tests/Codecov.Tests.csproj b/Source/Codecov.Tests/Codecov.Tests.csproj index 1a2f72a..fe9304d 100644 --- a/Source/Codecov.Tests/Codecov.Tests.csproj +++ b/Source/Codecov.Tests/Codecov.Tests.csproj @@ -3,12 +3,12 @@ netcoreapp2.1;netcoreapp3.0 - + runtime; build; native; contentfiles; analyzers all - + From 895730b785c3e28d868dad7fb1ee9e8d40ea42bd Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 09:57:48 +0100 Subject: [PATCH 06/10] (maint) Updated main library to .net core 3.1 --- Source/Codecov.Tests/Codecov.Tests.csproj | 46 +++++++++++------------ Source/Codecov/Codecov.csproj | 2 +- setup.cake | 21 +++++++---- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Source/Codecov.Tests/Codecov.Tests.csproj b/Source/Codecov.Tests/Codecov.Tests.csproj index fe9304d..521de69 100644 --- a/Source/Codecov.Tests/Codecov.Tests.csproj +++ b/Source/Codecov.Tests/Codecov.Tests.csproj @@ -1,25 +1,25 @@  - - netcoreapp2.1;netcoreapp3.0 - - - - runtime; build; native; contentfiles; analyzers - all - - - - - - - runtime; build; native; contentfiles; analyzers - all - - - - - - - - + + netcoreapp2.1;netcoreapp3.0 + + + + runtime; build; native; contentfiles; analyzers + all + + + + + + + runtime; build; native; contentfiles; analyzers + all + + + + + + + + diff --git a/Source/Codecov/Codecov.csproj b/Source/Codecov/Codecov.csproj index f109f81..f5fdd33 100644 --- a/Source/Codecov/Codecov.csproj +++ b/Source/Codecov/Codecov.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + netcoreapp3.1 win7-x64;linux-x64;osx-x64 diff --git a/setup.cake b/setup.cake index 0488597..4a0486e 100644 --- a/setup.cake +++ b/setup.cake @@ -1,5 +1,4 @@ #module "nuget:?package=Cake.DotNetTool.Module&version=0.2.0" -#addin "nuget:?package=Cake.Warp&version=0.1.0" #load "nuget:?package=Cake.Recipe&version=1.0.0" #load ".build/coverlet.cake" #load ".build/codecov.cake" @@ -52,39 +51,47 @@ Task("DotNetCore-Publish") NoBuild = true, NoRestore = true, OutputDirectory = BuildParameters.Paths.Directories.NuGetPackages, - MSBuildSettings = msBuildSettings + MSBuildSettings = msBuildSettings, }); var project = ParseProject(BuildParameters.SourceDirectoryPath + "/Codecov/Codecov.csproj", BuildParameters.Configuration); var runtimeIdentifiers = project.NetCore.RuntimeIdentifiers; + EnsureDirectoryExists(BuildParameters.Paths.Directories.Build); foreach (var runtime in runtimeIdentifiers) { + msBuildSettings = msBuildSettings + .WithProperty("PublishSingleFile", "true") + .WithProperty("PublishTrimmed", "true"); var outputDirectory = publishDirectory + "/" + runtime; - WarpPlatforms warpPlatform; string warpOutputBase = BuildParameters.Paths.Directories.Build + "/codecov-"; if (runtime.StartsWith("win")) { - warpPlatform = WarpPlatforms.WindowsX64; warpOutputBase += "windows-x64.exe"; } else if (runtime.StartsWith("osx")) { - warpPlatform = WarpPlatforms.MacOSX64; warpOutputBase += "osx-x64"; } else { - warpPlatform = WarpPlatforms.LinuxX64; warpOutputBase += "linux-x64"; } DotNetCorePublish(project.ProjectFilePath.FullPath, new DotNetCorePublishSettings { Runtime = runtime, + SelfContained = true, OutputDirectory = outputDirectory, MSBuildSettings = msBuildSettings }); - Warp(outputDirectory, (warpPlatform == WarpPlatforms.WindowsX64 ? "codecov.exe" : "codecov"), warpOutputBase, warpPlatform); + var files = GetFiles(outputDirectory + "/codecov*"); + foreach (var file in files) + { + if (file.GetExtension() != ".pdb") + { + CopyFile(file, warpOutputBase); + } + } } }); From 8828d0d28c0569c8d9dbe28d6467f04e159132d2 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 10:13:50 +0100 Subject: [PATCH 07/10] (maint) Update .net core used in github actions --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e67b3fc..5534ecf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Setup .NET Core + - name: Setup .NET Core 3.1 uses: actions/setup-dotnet@v1 with: - dotnet-version: 2.2.108 + dotnet-version: 3.1.101 - name: Build with cake run: ./build.ps1 -Verbosity Diagnostic shell: powershell From 25faae864b79fe41e1995f1c6636700eda95ca8c Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 10:14:23 +0100 Subject: [PATCH 08/10] (maint) Update .net core used on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 59042a9..4805b20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ os: - linux - osx mono: latest -dotnet: 3.0.100 +dotnet: 3.1.101 cache: directories: From d373f4d3c573e8cf66c35f85fc183e6d7366c5ed Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 10:54:44 +0100 Subject: [PATCH 09/10] (maint) Don't run github actions on tags --- .github/workflows/build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5534ecf..4612ce6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,10 @@ name: Build -on: [push, pull_request] +on: + push: + tags-ignore: + - '*' + pull_request: jobs: build: From f6b0c78b9a6210ed4544215b10395830da0fce23 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sat, 1 Feb 2020 10:55:29 +0100 Subject: [PATCH 10/10] (maint) Remove build file for travis There are issues with the build script preventing a successful run of on travis. Needs to be looked into at a later date. --- .travis.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4805b20..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: csharp -dist: xenial -os: - - linux - - osx -mono: latest -dotnet: 3.1.101 - -cache: - directories: - - tools - -env: - global: - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - -git: - depth: false - -branches: - only: - - master - - develop - - /release\/.*/ - - /hotfix\/.*/ - - /feature\/.*/ - - /bugfix\/.*/ - -script: - - ./build.sh