Skip to content

Commit

Permalink
Refresh build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jul 11, 2024
1 parent a98f5a4 commit 14ca8a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Install tools.
#tool dotnet:?package=GitVersion.Tool&version=5.12.0
#tool dotnet:?package=coveralls.net&version=4.0.1
#tool nuget:https://f.feedz.io/jericho/jericho/nuget/?package=GitReleaseManager&version=0.17.0-collaborators0004
#tool nuget:?package=ReportGenerator&version=5.3.5
#tool nuget:?package=xunit.runner.console&version=2.8.1
#tool nuget:https://f.feedz.io/jericho/jericho/nuget/?package=GitReleaseManager&version=0.17.0-collaborators0007
#tool nuget:?package=ReportGenerator&version=5.3.7
#tool nuget:?package=xunit.runner.console&version=2.9.0
#tool nuget:?package=CodecovUploader&version=0.7.3

// Install addins.
#addin nuget:?package=Cake.Coveralls&version=1.1.0
#addin nuget:?package=Cake.Coveralls&version=4.0.0
#addin nuget:?package=Cake.Git&version=4.0.0
#addin nuget:?package=Cake.Codecov&version=3.0.0

Expand Down Expand Up @@ -86,6 +86,8 @@ var isTagged = BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag && !string.
var isIntegrationTestsProjectPresent = FileExists(integrationTestsProject);
var isUnitTestsProjectPresent = FileExists(unitTestsProject);
var isBenchmarkProjectPresent = FileExists(benchmarkProject);
var removeIntegrationTests = isIntegrationTestsProjectPresent && (!isLocalBuild || target == "coverage");
var removeBenchmarks = isBenchmarkProjectPresent && (!isLocalBuild || target == "coverage");

var publishingError = false;

Expand Down Expand Up @@ -162,7 +164,7 @@ Setup(context =>
// Integration tests are intended to be used for debugging purposes and not intended to be executed in CI environment.
// Also, the runner for these tests contains windows-specific code (such as resizing window, moving window to center of screen, etc.)
// which can cause problems when attempting to run unit tests on an Ubuntu image on AppVeyor.
if (!isLocalBuild && isIntegrationTestsProjectPresent)
if (removeIntegrationTests)
{
Information("");
Information("Removing integration tests");
Expand All @@ -172,7 +174,7 @@ Setup(context =>
// Similarly, benchmarking can causes problems similar to this one:
// error NETSDK1005: Assets file '/home/appveyor/projects/stronggrid/Source/StrongGrid.Benchmark/obj/project.assets.json' doesn't have a target for 'net5.0'.
// Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project.
if (!isLocalBuild && isBenchmarkProjectPresent)
if (removeBenchmarks)
{
Information("");
Information("Removing benchmark project");
Expand All @@ -182,7 +184,7 @@ Setup(context =>

Teardown(context =>
{
if (!isLocalBuild)
if (removeIntegrationTests || removeBenchmarks)
{
Information("Restoring projects that may have been removed during build script setup");
GitCheckout(".", new FilePath[] { solutionFile });
Expand Down Expand Up @@ -352,7 +354,7 @@ Task("Generate-Code-Coverage-Report")
new FilePath(coverageFile),
codeCoverageDir,
new ReportGeneratorSettings() {
ClassFilters = new[] { "*.UnitTests*" }
ClassFilters = new[] { "+*" }
}
);
});
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.301",
"version": "8.0.303",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down

0 comments on commit 14ca8a3

Please sign in to comment.