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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run unit tests (windows)
if: matrix.os == 'windows-latest'
run: ./build.ps1 CodeCoverage
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: API checks
run: ./build.sh ApiChecks
- name: Upload artifacts
Expand Down Expand Up @@ -85,6 +87,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run sonarcloud analysis
run: ./build.sh CodeAnalysis

Expand Down Expand Up @@ -124,6 +127,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Pack nuget packages
run: ./build.sh Pack
- name: Upload packages
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run unit tests (windows)
if: matrix.os == 'windows-latest'
run: ./build.ps1 CodeCoverage
Expand Down Expand Up @@ -55,6 +56,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: API checks
run: ./build.sh ApiChecks
- name: Upload artifacts
Expand Down Expand Up @@ -86,6 +88,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run mutation tests
run: ./build.sh MutationTestsLinux MutationComment
env:
Expand All @@ -111,6 +114,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run mutation tests
run: ./build.ps1 MutationTestsWindows MutationComment
env:
Expand All @@ -135,6 +139,7 @@ jobs:
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run sonarcloud analysis
run: ./build.sh CodeAnalysis

Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageVersion Include="System.Threading.Channels" Version="9.0.8"/>
<PackageVersion Include="System.Threading.Channels" Version="6.0.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageVersion Include="System.Threading.Channels" Version="9.0.8"/>
<PackageVersion Include="System.Threading.Channels" Version="8.0.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net8.0' And '$(TargetFramework)' != 'net6.0' ">
<PackageVersion Include="System.Threading.Channels" Version="9.0.8"/>
Expand Down Expand Up @@ -47,8 +47,8 @@
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0"/>
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Testably.Abstractions.Interface" Version="9.0.0"/>
<PackageVersion Include="Testably.Abstractions" Version="9.0.0"/>
<PackageVersion Include="Testably.Abstractions.Interface" Version="10.0.0-pre.1"/>
<PackageVersion Include="Testably.Abstractions" Version="10.0.0-pre.1"/>
<PackageVersion Include="Testably.Abstractions.Testing" Version="4.3.8"/>
</ItemGroup>
<ItemGroup>
Expand Down
12 changes: 8 additions & 4 deletions Feature.Flags.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project>

<PropertyGroup>
<IS_NET21_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'netstandard2.1'">1</IS_NET21_OR_HIGHER>
<IS_NET6_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'">1</IS_NET6_OR_HIGHER>
<IS_NET8_OR_HIGHER Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'">1</IS_NET8_OR_HIGHER>
<IS_NET9_OR_HIGHER Condition="'$(TargetFramework)' == 'net9.0'">1</IS_NET9_OR_HIGHER>
<IS_NET21_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net10.0' OR '$(TargetFramework)' == 'netstandard2.1'">1</IS_NET21_OR_HIGHER>
<IS_NET6_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net10.0'">1</IS_NET6_OR_HIGHER>
<IS_NET8_OR_HIGHER Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net10.0'">1</IS_NET8_OR_HIGHER>
<IS_NET9_OR_HIGHER Condition="'$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net10.0'">1</IS_NET9_OR_HIGHER>
<IS_NET10_OR_HIGHER Condition="'$(TargetFramework)' == 'net10.0'">1</IS_NET10_OR_HIGHER>

<DefineConstants Condition="'$(TargetFramework)' == 'net48' OR '$(TargetFramework)' == 'netstandard2.0'">$(DefineConstants);NETFRAMEWORK</DefineConstants>
<DefineConstants Condition="'$(IS_NET6_OR_HIGHER)' == '1'">$(DefineConstants);CAN_SIMULATE_OTHER_OS</DefineConstants>
Expand Down Expand Up @@ -35,6 +36,9 @@
<DefineConstants Condition="'$(IS_NET9_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_PATH_SPAN</DefineConstants>
<DefineConstants Condition="'$(IS_NET9_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_FILE_SPAN</DefineConstants>
<DefineConstants Condition="'$(IS_NET9_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_GUID_V7</DefineConstants>
<DefineConstants Condition="'$(IS_NET10_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_GUID_PARSE_UTF8</DefineConstants>
<DefineConstants Condition="'$(IS_NET10_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_RANDOM_STRINGS</DefineConstants>
<DefineConstants Condition="'$(IS_NET10_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_COMPRESSION_ASYNC</DefineConstants>
</PropertyGroup>

</Project>
15 changes: 10 additions & 5 deletions Pipeline/Build.ApiChecks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ partial class Build
.DependsOn(Compile)
.Executes(() =>
{
Project[] projects =
[
Solution.Tests.Api.Testably_Abstractions_Api_Tests,
Solution.Tests.Api.Testably_Abstractions_Core_Api_Tests,
];
Project[] projects = BuildScope switch
{
BuildScope.CoreOnly => [Solution.Tests.Api.Testably_Abstractions_Core_Api_Tests,],
BuildScope.MainOnly => [Solution.Tests.Api.Testably_Abstractions_Api_Tests,],
_ =>
[
Solution.Tests.Api.Testably_Abstractions_Api_Tests,
Solution.Tests.Api.Testably_Abstractions_Core_Api_Tests,
],
};

DotNetTest(s => s
.SetConfiguration(Configuration)
Expand Down
3 changes: 2 additions & 1 deletion Pipeline/Build.CodeAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ partial class Build
.Unlisted()
.Before(Compile)
.Before(CodeCoverage)
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default)
.Executes(() =>
{
SonarScannerTasks.SonarScannerBegin(s => s
Expand All @@ -29,7 +30,7 @@ partial class Build
.Unlisted()
.DependsOn(Compile)
.DependsOn(CodeCoverage)
.OnlyWhenDynamic(() => IsServerBuild)
.OnlyWhenDynamic(() => IsServerBuild && BuildScope == BuildScope.Default)
.Executes(() =>
{
SonarScannerTasks.SonarScannerEnd(s => s
Expand Down
1 change: 1 addition & 0 deletions Pipeline/Build.CodeCoverage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ partial class Build
{
Target CodeCoverage => _ => _
.DependsOn(UnitTests)
.OnlyWhenDynamic(() => BuildScope != BuildScope.CoreOnly)
.Executes(() =>
{
ReportGenerator(s => s
Expand Down
7 changes: 6 additions & 1 deletion Pipeline/Build.MutationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ partial class Build
.After(MutationTestsLinux)
.After(MutationTestsWindows)
.OnlyWhenDynamic(() => GitHubActions.IsPullRequest)
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default)
.Executes(async () =>
{
int? prId = GitHubActions.PullRequestNumber;
Expand Down Expand Up @@ -83,6 +84,7 @@ await gitHubClient.Issue.Comment.Update("Testably", "Testably.Abstractions",
});

Target MutationTestPreparation => _ => _
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default)
.Executes(() =>
{
StrykerToolPath.CreateOrCleanDirectory();
Expand All @@ -97,11 +99,13 @@ await gitHubClient.Issue.Comment.Update("Testably", "Testably.Abstractions",
Target MutationTests => _ => _
.DependsOn(MutationTestsWindows)
.DependsOn(MutationTestsLinux)
.DependsOn(MutationComment);
.DependsOn(MutationComment)
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default);

Target MutationTestsLinux => _ => _
.DependsOn(Compile)
.DependsOn(MutationTestPreparation)
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default)
.Executes(() =>
{
AbsolutePath configFile = StrykerToolPath / "Stryker.Config.json";
Expand Down Expand Up @@ -210,6 +214,7 @@ await gitHubClient.Issue.Comment.Update("Testably", "Testably.Abstractions",
Target MutationTestsWindows => _ => _
.DependsOn(Compile)
.DependsOn(MutationTestPreparation)
.OnlyWhenDynamic(() => BuildScope == BuildScope.Default)
.Executes(() =>
{
AbsolutePath configFile = StrykerToolPath / "Stryker.Config.json";
Expand Down
70 changes: 38 additions & 32 deletions Pipeline/Build.Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,53 @@ partial class Build
packagesDirectory.CreateOrCleanDirectory();

List<string> packages = new();
Directory.CreateDirectory(packagesDirectory / "Main");
foreach (Project mainProject in MainProjects)
if (BuildScope != BuildScope.CoreOnly)
{
foreach (string package in
Directory.EnumerateFiles(mainProject.Directory / "bin", "*.nupkg",
SearchOption.AllDirectories))
Directory.CreateDirectory(packagesDirectory / "Main");
foreach (Project mainProject in MainProjects)
{
File.Move(package, packagesDirectory / "Main" / Path.GetFileName(package));
Debug("Found nuget package: {PackagePath}", package);
packages.Add(Path.GetFileName(package));
}
foreach (string package in
Directory.EnumerateFiles(mainProject.Directory / "bin", "*.nupkg",
SearchOption.AllDirectories))
{
File.Move(package, packagesDirectory / "Main" / Path.GetFileName(package));
Debug("Found nuget package: {PackagePath}", package);
packages.Add(Path.GetFileName(package));
}

foreach (string symbolPackage in
Directory.EnumerateFiles(mainProject.Directory / "bin", "*.snupkg",
SearchOption.AllDirectories))
{
File.Move(symbolPackage,
packagesDirectory / "Main" / Path.GetFileName(symbolPackage));
Debug("Found symbol package: {PackagePath}", symbolPackage);
foreach (string symbolPackage in
Directory.EnumerateFiles(mainProject.Directory / "bin", "*.snupkg",
SearchOption.AllDirectories))
{
File.Move(symbolPackage,
packagesDirectory / "Main" / Path.GetFileName(symbolPackage));
Debug("Found symbol package: {PackagePath}", symbolPackage);
}
}
}

Directory.CreateDirectory(packagesDirectory / "Core");
foreach (Project coreProject in CoreProjects)
if (BuildScope != BuildScope.MainOnly)
{
foreach (string package in
Directory.EnumerateFiles(coreProject.Directory / "bin", "*.nupkg",
SearchOption.AllDirectories))
Directory.CreateDirectory(packagesDirectory / "Core");
foreach (Project coreProject in CoreProjects)
{
File.Move(package, packagesDirectory / "Core" / Path.GetFileName(package));
Debug("Found nuget package: {PackagePath}", package);
packages.Add(Path.GetFileName(package));
}
foreach (string package in
Directory.EnumerateFiles(coreProject.Directory / "bin", "*.nupkg",
SearchOption.AllDirectories))
{
File.Move(package, packagesDirectory / "Core" / Path.GetFileName(package));
Debug("Found nuget package: {PackagePath}", package);
packages.Add(Path.GetFileName(package));
}

foreach (string symbolPackage in
Directory.EnumerateFiles(coreProject.Directory / "bin", "*.snupkg",
SearchOption.AllDirectories))
{
File.Move(symbolPackage,
packagesDirectory / "Core" / Path.GetFileName(symbolPackage));
Debug("Found symbol package: {PackagePath}", symbolPackage);
foreach (string symbolPackage in
Directory.EnumerateFiles(coreProject.Directory / "bin", "*.snupkg",
SearchOption.AllDirectories))
{
File.Move(symbolPackage,
packagesDirectory / "Core" / Path.GetFileName(symbolPackage));
Debug("Found symbol package: {PackagePath}", symbolPackage);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions Pipeline/Build.UnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ partial class Build
Target DotNetUnitTests => _ => _
.Unlisted()
.DependsOn(Compile)
.OnlyWhenDynamic(() => BuildScope != BuildScope.CoreOnly)
.Executes(() =>
{
string[] excludedFrameworks =
Expand Down
8 changes: 8 additions & 0 deletions Pipeline/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ namespace Build;
)]
partial class Build : NukeBuild
{
/// <summary>
/// Set this flag temporarily when you introduce breaking changes in the core library.
/// This will change the build pipeline to only build and publish the aweXpect.Core or aweXpect package.
/// <para />
/// Afterward, you can update the package reference in `Directory.Packages.props` and reset this flag.
/// </summary>
readonly BuildScope BuildScope = BuildScope.Default;

[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;

Expand Down
8 changes: 8 additions & 0 deletions Pipeline/BuildScope.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Build;

enum BuildScope
{
CoreOnly,
MainOnly,
Default,
}
4 changes: 2 additions & 2 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;net9.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0;net10.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(NetFrameworkOnly)' == 'True'">netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for .NET 10 Release (estimated November 2025) and revert it back to:

Suggested change
<LangVersion>preview</LangVersion>
<LangVersion>latest</LangVersion>

<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1701;1702;MA0003;MA0004;MA0042;MA0076;MA0105;MA0106;NU5104</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Loading
Loading