Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/execute-pipeline/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
steps:
- name: Run Pipeline
shell: bash
run: dotnet run -c Release --categories ${{ inputs.categories }}
run: dotnet run -c Release --no-build --categories ${{ inputs.categories }}
working-directory: "TUnit.Pipeline"
env:
ADMIN_TOKEN: ${{ inputs.admin-token }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ jobs:
"-p:RepositoryBranch=${{ steps.gitversion.outputs.branchName }}"
"-p:RepositoryCommit=${{ steps.gitversion.outputs.sha }}"

- name: Publish Mock Tests AOT
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
for fw in net8.0 net9.0 net10.0; do
dotnet publish TUnit.Mocks.Tests/TUnit.Mocks.Tests.csproj -c Release \
--use-current-runtime -p:Aot=true -o "MOCKTESTS_AOT_${fw}" --framework "${fw}" &
done
wait

- name: Expose GitHub Actions Runtime
uses: actions/github-script@v8
with:
Expand Down
1 change: 1 addition & 0 deletions TUnit.Pipeline/Modules/PackTUnitFilesModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ await context.DotNet()
Properties = properties,
IncludeSource = project == Sourcy.DotNet.Projects.TUnit_Templates ? false : true,
Configuration = "Release",
NoBuild = true,
}, new CommandExecutionOptions
{
LogSettings = new CommandLoggingOptions
Expand Down
106 changes: 0 additions & 106 deletions TUnit.Pipeline/Modules/PublishAndRunMockTestsAOTModule.cs

This file was deleted.

44 changes: 44 additions & 0 deletions TUnit.Pipeline/Modules/RunMockTestsAOTModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Runtime.InteropServices;
using ModularPipelines.Attributes;
using ModularPipelines.Configuration;
using ModularPipelines.Context;
using ModularPipelines.Extensions;
using ModularPipelines.Git.Extensions;
using ModularPipelines.Models;
using ModularPipelines.Modules;
using ModularPipelines.Options;

namespace TUnit.Pipeline.Modules;

[DependsOn<RunMockTestsModule>]
public class RunMockTestsAOTModule : Module<IReadOnlyList<CommandResult>>
{
protected override ModuleConfiguration Configure() => ModuleConfiguration.Create()
.WithSkipWhen(_ => EnvironmentVariables.IsNetFramework || !RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? SkipDecision.Skip("Only runs on Linux")
: SkipDecision.DoNotSkip)
.Build();

protected override async Task<IReadOnlyList<CommandResult>?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
{
var results = new List<CommandResult>();

var rootDir = context.Git().RootDirectory.AssertExists().Path;

foreach (var framework in new[] { "net8.0", "net9.0", "net10.0" })
{
var exePath = Path.Combine(rootDir, $"MOCKTESTS_AOT_{framework}", "TUnit.Mocks.Tests");

var runResult = await context.SubModule<CommandResult>($"Run-AOT-{framework}", async () =>
{
return await context.Shell.Bash.Command(
new BashCommandOptions($"DISABLE_GITHUB_REPORTER=true \"{exePath}\""),
cancellationToken);
});

results.Add(runResult);
}

return results;
}
}
Loading