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
1 change: 1 addition & 0 deletions .github/workflows/continous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
GITHUB_ACTIONS: true
run: ./build.ps1 --target Step1 --NugetApiKey ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v1
with:
Expand Down
50 changes: 44 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using static PowerShellCoreTasks;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Git;
using Serilog;
using Nuke.Common.Execution;

partial class Build : NukeBuild
{
Expand All @@ -19,25 +21,61 @@ partial class Build : NukeBuild
.DependentFor(GenerateModuleManifest, RunUnitTests, InvokePSAnalyzer)
.Executes(() =>
{
var currentLogger = Log.Logger;
Log.Logger = this.SimpleLogger;
PowerShellCore(_ => _
.SetFile(RunnersPath / "Install-Dependencies.ps1"));

PowerShellCore(_ => _
.SetFile(RunnersPath / "dependencies.runner.ps1"));

Log.Logger = currentLogger;
});

private ILogger _logger;
private ILogger SimpleLogger => _logger ??= new LoggerConfiguration()
.WriteTo.Console(
outputTemplate: "{Message:l}{NewLine}{Exception}",
applyThemeToRedirectedOutput: true)
.ConfigureInMemory(this)
.ConfigureFiles(this)
.ConfigureLevel()
.ConfigureFilter()
.CreateLogger();

private Target RunUnitTests => _ => _
.Executes(() => PowerShellCore(_ => _
.SetFile(RunnersPath / "unit-tests.runner.ps1")));
.Executes(() =>
{
var currentLogger = Log.Logger;
Log.Logger = this.SimpleLogger;

PowerShellCore(_ => _
.SetFile(RunnersPath / "unit-tests.runner.ps1"));

Log.Logger = currentLogger;
});

private Target RunIntegrationTests => _ => _
.OnlyWhenStatic(() => IsLocalBuild)
.Executes(() => PowerShellCore(_ => _
.SetFile(RunnersPath / "integration-tests.runner.ps1")));
.Executes(() =>
{
var currentLogger = Log.Logger;
Log.Logger = this.SimpleLogger;
PowerShellCore(_ => _
.SetFile(RunnersPath / "integration-tests.runner.ps1"));
Log.Logger = currentLogger;
});

private Target InvokePSAnalyzer => _ => _
.Executes(() => PowerShellCore(_ => _
.SetFile(RunnersPath / "script-analyzer.runner.ps1")));
.Executes(() =>
{
var currentLogger = Log.Logger;
Log.Logger = this.SimpleLogger;
PowerShellCore(_ => _
.SetFile(RunnersPath / "script-analyzer.runner.ps1"));
Log.Logger = currentLogger;

});

[GitVersion]
readonly GitVersion GitVersion;
Expand Down
1 change: 1 addition & 0 deletions runners/integration-tests.runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ $configuration.Run.Exit = $true
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = `
"${ProjectRoot}\test-results\integration-tests.${date}.xml"
$configuration.Output.CIFormat = 'GitHubActions'

Invoke-Pester -Configuration $configuration
1 change: 1 addition & 0 deletions runners/script-analyzer.runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ foreach ($file in $files) {
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = `
"${ProjectRoot}\test-results\analyzer.${file}.${date}.xml"
$configuration.Output.CIFormat = 'GitHubActions'

Invoke-Pester -Configuration $configuration
}
1 change: 1 addition & 0 deletions runners/test-modulemanifest.runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ $configuration.Run.Exit = $true
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = `
"${ProjectRoot}\test-results\test-modulemanifest.Tests.$(Get-Date -Format 'yyyy_MM_dd_HH_mm_ss').xml"
$configuration.Output.CIFormat = 'GitHubActions'

Invoke-Pester -Configuration $configuration
2 changes: 2 additions & 0 deletions runners/unit-tests.runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ $configuration.Run.Exit = $true
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = `
"${ProjectRoot}\test-results\unit-tests.${date}.xml"
$configuration.TestResult.OutputFormat
$configuration.Output.CIFormat = 'GitHubActions'

# Code Coverage
$configuration.CodeCoverage.Enabled = $true
Expand Down