Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}
path: ${{env.BUILD_ARTIFACT_PATH}}
path: |
${{env.BUILD_ARTIFACT_PATH}}
!${{env.BUILD_ARTIFACT_PATH}}/**/In/**/*

coverage:
name: 'Process Coverage'
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
- Includes the mandatory RFC [test vectors](https://github.com/daviddesmet/NaCl.Core/tree/master/test/NaCl.Core.Tests).
- [Project Wycheproof](https://github.com/google/wycheproof) by members of Google Security Team, for testing against known attacks (when applicable).

## Performance

Refer to the [benchmarks](https://github.com/daviddesmet/NaCl.Core/tree/master/test/NaCl.Core.Benchmarks) for performance numbers.

Check notice on line 82 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L82

Expected: 80; Actual: 130

Run the benchmarks using:
```bash

Check notice on line 85 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L85

Fenced code blocks should be surrounded by blank lines
dotnet run -c Release --framework net9.0
```

```bash
dotnet run -c Release --framework net9.0 --filter "*ChaCha20IntrinsicsBenchmark*"
```

## Learn More

[![License](https://img.shields.io/github/license/daviddesmet/NaCl.Core.svg)](https://github.com/daviddesmet/NaCl.Core/blob/master/LICENSE)
Expand Down
66 changes: 49 additions & 17 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#tool nuget:?package=ReportGenerator&version=5.3.0

var target = Argument("Target", "Default");
var configuration =
HasArgument("Configuration") ? Argument<string>("Configuration") :
Expand Down Expand Up @@ -42,23 +44,52 @@ Task("Test")
{
Information($"Preparing {project.GetFilename()} for test");

DotNetTest(
project.ToString(),
new DotNetTestSettings()
var settings = new DotNetTestSettings()
{
Blame = true,
Collectors = new string[] { "XPlat Code Coverage" },
Configuration = configuration,
Loggers = new string[]
{
Blame = true,
Collectors = new string[] { "XPlat Code Coverage" },
Configuration = configuration,
Loggers = new string[]
{
$"trx;LogFileName={project.GetFilenameWithoutExtension()}.trx",
$"html;LogFileName={project.GetFilenameWithoutExtension()}.html",
},
NoBuild = true,
NoRestore = true,
ResultsDirectory = $"{artifactsDirectory}/TestResults",
Settings = "CodeCoverage.runsettings"
});
$"trx;LogFileName={project.GetFilenameWithoutExtension()}.trx",
$"html;LogFileName={project.GetFilenameWithoutExtension()}.html",
},
NoBuild = true,
NoRestore = true,
ResultsDirectory = $"{artifactsDirectory}/TestResults",
Settings = "CodeCoverage.runsettings"
};

// Platform-specific intrinsics testing
if (IsRunningOnUnix() && Environment.OSVersion.Platform == PlatformID.Unix)
{
// ARM/Mac testing with AdvSIMD
settings.EnvironmentVariables["COMPlus_EnableAdvSimd"] = "1";
Information($"Running default {project.GetFilename()} test with ARM AdvSIMD enabled");
DotNetTest(project.ToString(), settings);

settings.EnvironmentVariables["COMPlus_EnableAdvSimd"] = "0";
Information($"Running {project.GetFilename()} test with ARM AdvSIMD disabled (scalar only)");
DotNetTest(project.ToString(), settings);
}
else
{
// x86/x64 testing with AVX2/SSE3
settings.EnvironmentVariables["COMPlus_EnableAVX2"] = "1";
settings.EnvironmentVariables["COMPlus_EnableSSE3"] = "1";
Information($"Running default {project.GetFilename()} test with SSE3 and AVX2 enabled");
DotNetTest(project.ToString(), settings);

settings.EnvironmentVariables["COMPlus_EnableAVX2"] = "0";
settings.EnvironmentVariables["COMPlus_EnableSSE3"] = "1";
Information($"Running {project.GetFilename()} test with SSE3 enabled and AVX2 disabled");
DotNetTest(project.ToString(), settings);

settings.EnvironmentVariables["COMPlus_EnableAVX2"] = "0";
settings.EnvironmentVariables["COMPlus_EnableSSE3"] = "0";
Information($"Running {project.GetFilename()} test with SSE3 and AVX2 disabled");
DotNetTest(project.ToString(), settings);
}
});

Task("CoverageReport")
Expand All @@ -72,7 +103,7 @@ Task("CoverageReport")
ArgumentCustomization = args => args.Append("-reporttypes:HtmlInline;HTMLChart;Cobertura")
});
});

Task("Pack")
.Description("Creates the NuGet packages and outputs them to the artifacts directory.")
.Does(() =>
Expand All @@ -97,6 +128,7 @@ Task("Default")
.Description("Cleans, restores, builds the solution, runs unit tests and then create the NuGet packages.")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("CoverageReport")
.IsDependentOn("Pack");

RunTarget(target);
Loading
Loading