Skip to content

Commit

Permalink
chore: Rebuild on pack target
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Feb 25, 2024
1 parent e6a9226 commit e6f1746
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ jobs:
run: dotnet cake --target=Build

- name: Run Tests
# run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }}
run: dotnet cake --target=Create-NuGet-Packages
run: |
dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }}
dotnet cake --target=Create-NuGet-Packages
- name: Upload Test And Coverage Results
uses: actions/upload-artifact@v4
Expand Down
4 changes: 1 addition & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)src/strongname.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup>
<NoWarn>CS0618,CS1591,SA0001,SA1600,SA1633,SA1649,CA1859,CA1861</NoWarn>
Expand All @@ -31,9 +32,6 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- <PropertyGroup>
<DebugType>embedded</DebugType>
</PropertyGroup> -->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)docs/banner.png" Visible="false" Pack="true" PackagePath="docs/" />
<None Include="$(MSBuildThisFileDirectory)docs/logo.png" Visible="false" Pack="true" PackagePath="docs/" />
Expand Down
13 changes: 9 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Task("Build")
Verbosity = param.Verbosity,
NoRestore = true,
ArgumentCustomization = args => args
.Append($"/p:DebugType=embedded")
.Append($"/p:ContinuousIntegrationBuild=true")
});
});

Expand Down Expand Up @@ -126,15 +124,22 @@ Task("Create-NuGet-Packages")
.WithCriteria(() => param.ShouldPublish || true)
.Does(() =>
{
// TODO: Generate the Semantic Version number on GitHub Actions workflow tag
// events, together with GitVersion.
var hyphenIndex = param.Version.IndexOf('-');
var versionInfo = param.Version.Substring(0, hyphenIndex >= 0 ? hyphenIndex : param.Version.Length);
DotNetPack(param.Solution, new DotNetPackSettings
{
Configuration = param.Configuration,
Verbosity = param.Verbosity,
NoRestore = true,
NoBuild = true,
NoRestore = false,
NoBuild = false,
OutputDirectory = param.Paths.Directories.NuGetDirectoryPath,
ArgumentCustomization = args => args
.Append($"/p:Version={param.Version}")
.Append($"/p:AssemblyVersion={versionInfo}")
.Append($"/p:FileVersion={versionInfo}")
});
});

Expand Down
20 changes: 10 additions & 10 deletions tests/Testcontainers.Tests/Unit/Builders/CommonDirectoryPathTest.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
namespace DotNet.Testcontainers.Tests.Unit
{
using System.Collections.Generic;
using System.IO;
using DotNet.Testcontainers.Builders;
using Xunit;

public sealed class CommonDirectoryPathTest
{
public static IEnumerable<object[]> CommonDirectoryPaths { get; }
= new[]
{
new[] { (object)CommonDirectoryPath.GetBinDirectory() },
new[] { (object)CommonDirectoryPath.GetGitDirectory() },
new[] { (object)CommonDirectoryPath.GetProjectDirectory() },
new[] { (object)CommonDirectoryPath.GetSolutionDirectory() },
new[] { (object)CommonDirectoryPath.GetCallerFileDirectory() },
};
public static TheoryData<CommonDirectoryPath> CommonDirectoryPaths()
{
var theoryData = new TheoryData<CommonDirectoryPath>();
theoryData.Add(CommonDirectoryPath.GetBinDirectory());
theoryData.Add(CommonDirectoryPath.GetGitDirectory());
theoryData.Add(CommonDirectoryPath.GetProjectDirectory());
theoryData.Add(CommonDirectoryPath.GetSolutionDirectory());
theoryData.Add(CommonDirectoryPath.GetCallerFileDirectory());
return theoryData;
}

[Theory]
[MemberData(nameof(CommonDirectoryPaths))]
Expand Down

0 comments on commit e6f1746

Please sign in to comment.