Skip to content

Commit

Permalink
Merge branch 'master' into fix-validators
Browse files Browse the repository at this point in the history
  • Loading branch information
YegorStepanov authored Nov 22, 2022
2 parents b19c33b + ccbaf08 commit d30865b
Show file tree
Hide file tree
Showing 280 changed files with 6,528 additions and 1,122 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run
shell: cmd
run: |
Expand All @@ -17,7 +17,7 @@ jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
Expand All @@ -30,6 +30,6 @@ jobs:
build-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run
run: ./build.sh
64 changes: 64 additions & 0 deletions .github/workflows/docs-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: docs-stable

on:
push:
branches:
- docs-stable
workflow_dispatch:

permissions: write-all

jobs:
build:
runs-on: windows-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
ref: docs-stable

- name: Build BenchmarkDotNet
run: ./build.bat --target Build

# Temporary disabled because of the API limit
# - name: Download changelog
# run: ./build.bat --target DocFX_Changelog_Download --LatestVersions true --StableVersions true
# env:
# GITHUB_PRODUCT: ChangelogBuilder
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
run: ./build.bat --target DocFX_Build

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: site
path: docs/_site

deploy:
concurrency: ci-${{ github.ref }}
needs: [build]
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
ref: docs-stable

- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: site

- name: Deploy documentation
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: site
GIT_CONFIG_NAME: Andrey Akinshin
GIT_CONFIG_EMAIL: [email protected]
CLEAN: true
28 changes: 28 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Documentation Checks

on:
push:
branches:
- master
paths:
- "docs/**/*"
pull_request:
branches:
- master
paths:
- "docs/**/*"
jobs:
spellcheck:
name: "Docs: Spellcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Check out the code
- uses: actions/setup-node@v1
name: Setup node
with:
node-version: "16"
- run: npm install -g cspell
name: Install cSpell
- run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress
name: Run cSpell
4 changes: 1 addition & 3 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
<clear />

<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="perfolizer-nightly" value="https://www.myget.org/F/perfolizer/api/v3/index.json" />
<!-- reuquired to run Mono Wasm benchmarks -->
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<!-- reuquired to run Mono AOT benchmarks -->
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion build/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
Expand Down
57 changes: 51 additions & 6 deletions build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -47,6 +48,11 @@ public class BuildContext : FrostingContext

public DirectoryPath ChangeLogDirectory { get; }
public DirectoryPath ChangeLogGenDirectory { get; }

public DirectoryPath RedirectRootDirectory { get; }
public DirectoryPath RedirectProjectDirectory { get; }
public DirectoryPath RedirectSourceDirectory { get; }
public DirectoryPath RedirectTargetDirectory { get; }

public FilePath SolutionFile { get; }
public FilePath UnitTestsProjectFile { get; }
Expand Down Expand Up @@ -80,6 +86,11 @@ public BuildContext(ICakeContext context)

ChangeLogDirectory = RootDirectory.Combine("docs").Combine("changelog");
ChangeLogGenDirectory = RootDirectory.Combine("docs").Combine("_changelog");

RedirectRootDirectory = RootDirectory.Combine("docs").Combine("_redirects");
RedirectProjectDirectory = RedirectRootDirectory.Combine("RedirectGenerator");
RedirectSourceDirectory = RedirectRootDirectory.Combine("redirects");
RedirectTargetDirectory = RootDirectory.Combine("docs").Combine("_site");

SolutionFile = RootDirectory.CombineWithFilePath("BenchmarkDotNet.sln");
UnitTestsProjectFile = RootDirectory.Combine("tests").Combine("BenchmarkDotNet.Tests")
Expand Down Expand Up @@ -132,7 +143,7 @@ public void RunTests(FilePath projectFile, string alias, string tfm)
public void DocfxChangelogDownload(string version, string versionPrevious, string lastCommit = "")
{
this.Information("DocfxChangelogDownload: " + version);
// Required environment variables: GITHIB_PRODUCT, GITHUB_TOKEN
// Required environment variables: GITHUB_PRODUCT, GITHUB_TOKEN
var changeLogBuilderDirectory = ChangeLogGenDirectory.Combine("ChangeLogBuilder");
var changeLogBuilderProjectFile = changeLogBuilderDirectory.CombineWithFilePath("ChangeLogBuilder.csproj");
this.DotNetRun(changeLogBuilderProjectFile.FullPath,
Expand Down Expand Up @@ -198,11 +209,26 @@ public void RunDocfx(FilePath docfxJson, string args = "")
else
this.StartProcess(DocfxExeFile.FullPath, new ProcessSettings { Arguments = docfxJson + " " + args });
}

public void GenerateRedirects()
{
var redirectProjectFile = RedirectProjectDirectory.CombineWithFilePath("RedirectGenerator.csproj");
this.Information(redirectProjectFile.FullPath);
this.DotNetBuild(redirectProjectFile.FullPath);
this.DotNetRun(redirectProjectFile.FullPath, new DotNetRunSettings
{
WorkingDirectory = RedirectProjectDirectory,
});

this.Information(RedirectTargetDirectory);
this.EnsureDirectoryExists(RedirectTargetDirectory);
this.CopyFiles(RedirectSourceDirectory + "/**/*", RedirectTargetDirectory, true);
}
}

public static class DocumentationHelper
{
public const string DocFxVersion = "2.59.3";
public const string DocFxVersion = "2.59.4";

public static readonly string[] BdnAllVersions =
{
Expand Down Expand Up @@ -428,12 +454,19 @@ public override void Run(BuildContext context)
context.DocfxChangelogDownload(
DocumentationHelper.BdnAllVersions[i],
DocumentationHelper.BdnAllVersions[i - 1]);
} else if (context.Argument("LatestVersions", false))
{
for (int i = DocumentationHelper.BdnAllVersions.Length - 2; i < DocumentationHelper.BdnAllVersions.Length; i++)
context.DocfxChangelogDownload(
DocumentationHelper.BdnAllVersions[i],
DocumentationHelper.BdnAllVersions[i - 1]);
}

context.DocfxChangelogDownload(
DocumentationHelper.BdnNextVersion,
DocumentationHelper.BdnAllVersions.Last(),
"HEAD");
if (!context.Argument("StableVersions", false))
context.DocfxChangelogDownload(
DocumentationHelper.BdnNextVersion,
DocumentationHelper.BdnAllVersions.Last(),
"HEAD");
}
}

Expand All @@ -454,6 +487,15 @@ public override void Run(BuildContext context)
}
}

[TaskName("DocFX_Generate_Redirects")]
public class DocfxGenerateRedirectsTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.GenerateRedirects();
}
}

// In order to work around xref issues in DocFx, BenchmarkDotNet and BenchmarkDotNet.Annotations must be build
// before running the DocFX_Build target. However, including a dependency on BuildTask here may have unwanted
// side effects (CleanTask).
Expand All @@ -466,6 +508,7 @@ public class DocfxChangelogBuildTask : FrostingTask<BuildContext>
public override void Run(BuildContext context)
{
context.RunDocfx(context.DocfxJsonFile);
context.GenerateRedirects();
}
}

Expand All @@ -476,6 +519,8 @@ public class DocfxChangelogServeTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.RunDocfx(context.DocfxJsonFile);
context.GenerateRedirects();
context.RunDocfx(context.DocfxJsonFile, "--serve");
}
}
108 changes: 108 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"version": "0.2",
"language": "en",
"words": [
"Alloc",
"analyse",
"analyser",
"Analysers",
"Autofac",
"bitness",
"corlib",
"Cygwin",
"Diagnoser",
"diagnosers",
"disassemblers",
"disassm",
"Jits",
"Jitting",
"LINQ",
"microbenchmarking",
"microbenchmarks",
"Mispredict",
"Mispredictions",
"msbuild",
"Multimodal",
"multimodality",
"netcoreapp",
"powerplans",
"Pseudocode",
"runtimes",
"Serilog",
"Tailcall",
"toolchains",
"unmanaged"
],
"ignoreWords": [
"Akinshin",
"Andrey",
"Expecto",
"Jint",
"LoongArch64",
"macrobenchmark",
"MediatR",
"Nagórski's",
"Newtonsoft",
"NodaTime",
"Npgsql",
"Sitnik's",
"Wojciech",
"Avalonia",
"Gitter"
],
"patterns": [
{
"name": "Markdown links",
"pattern": "\\((.*)\\)",
"description": ""
},
{
"name": "Markdown code blocks",
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
},
{
"name": "Inline code blocks",
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
},
{
"name": "Link contents",
"pattern": "\\<a(.*)\\>",
"description": ""
},
{
"name": "Snippet references",
"pattern": "-- snippet:(.*)",
"description": ""
},
{
"name": "Snippet references 2",
"pattern": "\\<\\[sample:(.*)",
"description": "another kind of snippet reference"
},
{
"name": "Multi-line code blocks",
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
},
{
"name": "HTML Tags",
"pattern": "<[^>]*>",
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
}
],
"ignoreRegExpList": [
"Markdown links",
"Markdown code blocks",
"Inline code blocks",
"Link contents",
"Snippet references",
"Snippet references 2",
"Multi-line code blocks",
"HTML Tags"
],
"ignorePaths": [
"docs/_changelog/**/*.md",
"docs/articles/team.md"
]
}
2 changes: 1 addition & 1 deletion docs/_changelog/footer/v0.10.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _Date: June 05, 2017_

_Milestone: [v0.10.7](https://github.com/PerfDotNet/BenchmarkDotNet/issues?q=milestone%3Av0.10.7)_

_Overview post: http://aakinshin.net/blog/post/bdn-v0_10_7/_
_Overview post: https://aakinshin.net/posts/bdn-v0_10_7/_

_NuGet Packages:_
* https://www.nuget.org/packages/BenchmarkDotNet/0.10.7
Expand Down
4 changes: 2 additions & 2 deletions docs/_changelog/header/v0.10.10.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Highlights:

* Disassembly Diagnoser (read more here: [Disassembling .NET Code with BenchmarkDotNet](http://adamsitnik.com/Disassembly-Diagnoser/))
* Disassembly Diagnoser (read more here: [Disassembling .NET Code with BenchmarkDotNet](https://adamsitnik.com/Disassembly-Diagnoser/))
* ParamsSources
* .NET Core x86 support
* Environment variables and Mono args support
* Better environment description
* More: additional sections in the documentation, bug fixes, build script improvements, internal refactoring.

Overview post: [BenchmarkDotNet v0.10.10](http://aakinshin.net/blog/post/bdn-v0_10_10/)
Overview post: [BenchmarkDotNet v0.10.10](https://aakinshin.net/posts/bdn-v0_10_10/)
Loading

0 comments on commit d30865b

Please sign in to comment.