Skip to content

Commit 14ed36b

Browse files
committed
(build) cleanup
1 parent 8dc25d6 commit 14ed36b

File tree

9 files changed

+29
-34
lines changed

9 files changed

+29
-34
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,13 @@ jobs:
137137
shell: pwsh
138138
run: dotnet run/build.dll --target=Test --dotnet_target=${{ matrix.targetFramework }}
139139

140-
artifacts_linux_test:
141-
name: Test artifacts in docker
140+
artifacts_windows_test:
141+
name: Test artifacts on windows
142142
needs: [build]
143-
runs-on: ubuntu-latest
143+
runs-on: windows-latest
144144
strategy:
145145
matrix:
146-
targetFramework: [ '3.1', '5.0' ]
147-
distro: [ alpine.3.12-x64, centos.7-x64, centos.8-x64, debian.9-x64, debian.10-x64, fedora.33-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
146+
package: [ Executable, MsBuildFull ]
148147
fail-fast: false
149148

150149
steps:
@@ -174,24 +173,19 @@ jobs:
174173
with:
175174
name: nuget
176175
path: ${{ github.workspace }}/artifacts/packages/nuget
177-
-
178-
uses: actions/[email protected]
179-
name: Download native packages
180-
with:
181-
name: native-${{ runner.os }}
182-
path: ${{ github.workspace }}/artifacts/packages/native
183176
-
184177
name: '[Test Artifacts]'
185178
shell: pwsh
186-
run: dotnet run/artifacts.dll --target=ArtifactsTest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
179+
run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test
187180

188-
artifacts_windows_test:
189-
name: Test artifacts on windows
181+
artifacts_linux_test:
182+
name: Test artifacts in docker
190183
needs: [build]
191-
runs-on: windows-latest
184+
runs-on: ubuntu-latest
192185
strategy:
193186
matrix:
194-
package: [ Executable, MsBuildFull ]
187+
targetFramework: [ '3.1', '5.0' ]
188+
distro: [ alpine.3.12-x64, centos.7-x64, centos.8-x64, debian.9-x64, debian.10-x64, fedora.33-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
195189
fail-fast: false
196190

197191
steps:
@@ -221,10 +215,16 @@ jobs:
221215
with:
222216
name: nuget
223217
path: ${{ github.workspace }}/artifacts/packages/nuget
218+
-
219+
uses: actions/[email protected]
220+
name: Download native packages
221+
with:
222+
name: native-${{ runner.os }}
223+
path: ${{ github.workspace }}/artifacts/packages/native
224224
-
225225
name: '[Test Artifacts]'
226226
shell: pwsh
227-
run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test
227+
run: dotnet run/artifacts.dll --target=ArtifactsTest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
228228

229229
docker_linux_images:
230230
name: Build, Test and Publish Docker Images
@@ -289,7 +289,7 @@ jobs:
289289

290290
publish:
291291
name: Publish
292-
needs: [docker_linux_images, artifacts_windows_test, artifacts_linux_test]
292+
needs: [artifacts_windows_test, artifacts_linux_test, docker_linux_images]
293293
runs-on: windows-latest
294294
strategy:
295295
matrix:

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ site/
106106
# Cake
107107
####################
108108
tools/*
109+
run/*
109110
!tools/packages.config
110111
/*.zip
111112
GitVersion.CommandLine/*/
@@ -126,7 +127,3 @@ config.wyam.hash
126127
config.wyam.packages.xml
127128
/tests/integration/core/build
128129
/tests/integration/full/build
129-
130-
run/
131-
132-
build/build/tools/

build/artifacts/Tasks/ArtifactsExecutableTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public override void Run(BuildContext context)
3232
PackageTest(context, packageToTest);
3333
}
3434
}
35-
private static void PackageTest(BuildContext context, string packageToTest)
35+
private static void PackageTest(BuildContextBase context, string packageToTest)
3636
{
3737
if (context.Version == null)
3838
return;

build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override void Run(BuildContext context)
3939
var dotnetCoreMsBuildSettings = new DotNetCoreMSBuildSettings();
4040
dotnetCoreMsBuildSettings.WithProperty("TargetFramework", framework);
4141
dotnetCoreMsBuildSettings.WithProperty("GitVersionMsBuildVersion", version);
42-
var projPath = context.MakeAbsolute(new DirectoryPath("./tests/integration/core"));
42+
var projPath = context.MakeAbsolute(Paths.Integration.Combine("core"));
4343

4444
context.DotNetCoreBuild(projPath.FullPath, new DotNetCoreBuildSettings
4545
{
@@ -49,7 +49,7 @@ public override void Run(BuildContext context)
4949
ArgumentCustomization = args => args.Append($"--source {nugetSource}")
5050
});
5151

52-
var netcoreExe = new DirectoryPath("./tests/integration/core/build").Combine(framework).CombineWithFilePath("app.dll");
52+
var netcoreExe = Paths.Integration.Combine("core").Combine("build").Combine(framework).CombineWithFilePath("app.dll");
5353
context.ValidateOutput("dotnet", netcoreExe.FullPath, context.Version.GitVersion.FullSemVer);
5454
}
5555

@@ -66,7 +66,7 @@ public override void Run(BuildContext context)
6666

6767
context.MSBuild("./tests/integration/full", msBuildSettings);
6868

69-
var fullExe = new DirectoryPath("./tests/integration/full/build").CombineWithFilePath("app.exe");
69+
var fullExe = Paths.Integration.Combine("full").Combine("build").CombineWithFilePath("app.exe");
7070
context.ValidateOutput(fullExe.FullPath, null, context.Version.GitVersion.FullSemVer);
7171
}
7272
}

build/artifacts/Tasks/ArtifactsNativeTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public override bool ShouldRun(BuildContext context)
2121

2222
public override void Run(BuildContext context)
2323
{
24-
if (context.Version == null)
24+
if (context.Version?.SemVersion == null)
2525
return;
26-
var version = context.Version.SemVersion;
26+
var version = context.Version.SemVersion.ToLower();
2727
var rootPrefix = string.Empty;
2828

2929
foreach (var dockerImage in context.Images)

build/common/Utilities/DockerContextExtensions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Cake.Common.Diagnostics;
66
using Cake.Common.IO;
77
using Cake.Core;
8-
using Cake.Core.IO;
98
using Cake.Docker;
109
using Xunit;
1110

@@ -16,15 +15,15 @@ public static class DockerContextExtensions
1615
public static void DockerBuild(this BuildContextBase context, DockerImage dockerImage)
1716
{
1817
var (distro, targetFramework, registry, _) = dockerImage;
19-
var workDir = DirectoryPath.FromString($"./src/Docker");
18+
var workDir = Paths.Src.Combine("Docker");
2019
var tags = context.GetDockerTags(dockerImage);
2120

2221
if (context.Version == null) return;
2322
var buildSettings = new DockerImageBuildSettings
2423
{
2524
Rm = true,
2625
Tag = tags.ToArray(),
27-
File = $"{workDir}/Dockerfile",
26+
File = workDir.CombineWithFilePath("Dockerfile").FullPath,
2827
BuildArg = new[]
2928
{
3029
$"contentFolder=/content",
@@ -43,7 +42,6 @@ public static void DockerBuild(this BuildContextBase context, DockerImage docker
4342
public static void DockerPush(this BuildContextBase context, DockerImage dockerImage)
4443
{
4544
var tags = context.GetDockerTags(dockerImage);
46-
4745
foreach (var tag in tags)
4846
{
4947
context.DockerPush(tag);

build/common/Utilities/Paths.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class Paths
1010
public static readonly DirectoryPath Src = Root.Combine("src");
1111
public static readonly DirectoryPath Docs = Root.Combine("docs");
1212
public static readonly DirectoryPath Build = Root.Combine("build");
13+
public static readonly DirectoryPath Integration = Root.Combine("tests").Combine("integration");
1314

1415
public static readonly DirectoryPath Nuspec = Build.Combine("nuspec");
1516

build/docker/Tasks/DockerBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override bool ShouldRun(BuildContext context)
2323
public override void Run(BuildContext context)
2424
{
2525
var tool = Paths.Nuget.CombineWithFilePath("GitVersion.Tool*");
26-
var dest = DirectoryPath.FromString($"./src/Docker").Combine("content");
26+
var dest = Paths.Src.Combine("Docker").Combine("content");
2727
context.EnsureDirectoryExists(dest);
2828
context.CopyFiles(tool.FullPath, dest);
2929

build/docker/Tasks/DockerPublish.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using Cake.Common.Diagnostics;
32
using Cake.Frosting;
43
using Common.Utilities;
54

0 commit comments

Comments
 (0)