Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/Docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
Expand All @@ -43,11 +43,13 @@ jobs:
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Run './build.cmd Docker'
run: ./build.cmd Docker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/Windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
Expand All @@ -38,7 +38,7 @@ jobs:
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,51 @@ jobs:
name: windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
run: chmod +x ./build.cmd
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.*
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Run './build.cmd All'
run: ./build.cmd All
- name: Run './build.cmd BuildRelease RunTests NBench CreateNuGet'
run: ./build.cmd BuildRelease RunTests NBench CreateNuGet
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
run: chmod +x ./build.cmd
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.*
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Run './build.cmd All'
run: ./build.cmd All
- name: Run './build.cmd BuildRelease RunTests NBench CreateNuGet'
run: ./build.cmd BuildRelease RunTests NBench CreateNuGet
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 7 additions & 8 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,22 @@
"enum": [
"All",
"AssemblyInfo",
"AuthenticatedGitHubClient",
"BuildDockerImages",
"BuildRelease",
"Clean",
"Compile",
"CreateNuget",
"CreateNuGet",
"DocFx",
"Docker",
"DockerLogin",
"DocsInit",
"DocsMetadata",
"GitHubRelease",
"Install",
"NBench",
"Nuget",
"PublishCode",
"PublishDockerImages",
"PublishNuget",
"PublishNuGet",
"PushImage",
"Restore",
"RunTests",
Expand All @@ -134,31 +132,32 @@
"enum": [
"All",
"AssemblyInfo",
"AuthenticatedGitHubClient",
"BuildDockerImages",
"BuildRelease",
"Clean",
"Compile",
"CreateNuget",
"CreateNuGet",
"DocFx",
"Docker",
"DockerLogin",
"DocsInit",
"DocsMetadata",
"GitHubRelease",
"Install",
"NBench",
"Nuget",
"PublishCode",
"PublishDockerImages",
"PublishNuget",
"PublishNuGet",
"PushImage",
"Restore",
"RunTests",
"ServeDocs"
]
}
},
"TestTimeout": {
"type": "string"
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
Expand Down
2 changes: 1 addition & 1 deletion build/Build.CI.GitHubActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
AutoGenerate = false,
OnPushBranches = new[] { "master", "dev" },
OnPullRequestBranches = new[] { "master", "dev" },
InvokedTargets = new[] { nameof(All) },
InvokedTargets = new[] { nameof(BuildRelease), nameof(RunTests), nameof(NBench), nameof(CreateNuGet) },
PublishArtifacts = true,
EnableGitHubToken = true)
]
Expand Down
29 changes: 22 additions & 7 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ partial class Build : NukeBuild

[Parameter] string DockerRegistryUrl;

//usage:
//./build.cmd runtests --test-timeout 300s
[Parameter] string TestTimeout = "30m";

[Parameter] [Secret] string DockerUsername;
[Parameter] [Secret] string DockerPassword;
Expand All @@ -77,7 +80,10 @@ partial class Build : NukeBuild
GitHubActions GitHubActions => GitHubActions.Instance;
private long BuildNumber()
{
return GitHubActions.RunNumber;
if (GitHubActions != null!)
return GitHubActions.RunNumber;

return 0;
}
private string PreReleaseVersionSuffix()
{
Expand Down Expand Up @@ -111,14 +117,14 @@ private string PreReleaseVersionSuffix()
.SetProjectFile(Solution));
});

Target CreateNuget => _ => _
Target CreateNuGet => _ => _
.Description("Creates nuget packages")
.DependsOn(RunTests)
.Executes(() =>
{
var version = ReleaseNotes.Version.ToString();
var version = Version(ReleaseNotes, NugetPrerelease);
var releaseNotes = GetNuGetReleaseNotes(ChangelogFile, GitRepository);

var versionSuffix = VersionSuffix;
var projects = SourceDirectory.GlobFiles("**/*.csproj")
.Except(SourceDirectory.GlobFiles("**/*Tests.csproj", "**/*Tests*.csproj"));
foreach (var project in projects)
Expand Down Expand Up @@ -200,10 +206,10 @@ private string PreReleaseVersionSuffix()
public Target PublishDockerImages => _ => _
.DependsOn(DockerLogin, Docker, PushImage);

Target PublishNuget => _ => _
Target PublishNuGet => _ => _
.Unlisted()
.Description("Publishes .nuget packages to Nuget")
.After(CreateNuget)
.After(CreateNuGet)
.OnlyWhenDynamic(() => !NugetPublishUrl.IsNullOrEmpty())
.OnlyWhenDynamic(() => !NugetKey.IsNullOrEmpty())
.Executes(async() =>
Expand Down Expand Up @@ -314,14 +320,17 @@ IEnumerable<Project> GetProjects()
.SetResultsDirectory(OutputTests)
.SetProcessWorkingDirectory(Directory.GetParent(project).FullName)
.SetLoggers("trx")
.SetBlameCrash(true)
.SetBlameHang(true)
.SetBlameHangTimeout(TestTimeout)
.SetVerbosity(verbosity: DotNetVerbosity.Normal)
.EnableNoBuild());
}
}
});

Target Nuget => _ => _
.DependsOn(CreateNuget, PublishNuget);
.DependsOn(CreateNuGet, PublishNuGet);
private AbsolutePath[] GetDockerProjects()
{
return SourceDirectory.GlobFiles("**/Dockerfile")// folders with Dockerfiles in it
Expand Down Expand Up @@ -436,4 +445,10 @@ static void Information(string info)
{
Serilog.Log.Information(info);
}
static string Version(ReleaseNotes releaseNotes, string nugetPrerelease)
{
var version = releaseNotes.Version.ToString();
version = nugetPrerelease == "dev" ? version.Split('-')[0] : version;
return version;
}
}
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<!-- Test dependencies -->
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="Akka.TestKit.XUnit2" Version="$(AkkaVersion)" />
Expand Down