Skip to content
Merged
15 changes: 3 additions & 12 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ jobs:
restore-keys: |
nuget-${{ runner.os }}-
- name: Docker Setup Docker
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-docker-action@v5.0.0

- name: Cache Playwright Browsers
uses: actions/cache@v5
continue-on-error: true
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
Expand All @@ -102,13 +97,9 @@ jobs:
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright
run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Install Playwright (browsers only)
run: npx playwright install
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Docker Setup Docker
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-docker-action@v5.0.0

- name: Enable Long Paths on Windows
if: matrix.os == 'windows-latest'
Expand Down
3 changes: 2 additions & 1 deletion TUnit.CI.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@
<Project Path="TUnit.TestProject.VB.NET/TUnit.TestProject.VB.NET.vbproj" />
</Folder>

<!-- Templates package (content projects excluded - not needed for CI) -->
<!-- Templates package -->
<Folder Name="/Templates/">
<Project Path="TUnit.Templates/TUnit.Templates.csproj" />
<Project Path="TUnit.Templates/content/TUnit.Playwright/TestProject.csproj" />
</Folder>
</Solution>
14 changes: 14 additions & 0 deletions TUnit.Pipeline/Modules/InstallPlaywrightModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using ModularPipelines.Context;
using ModularPipelines.Models;
using ModularPipelines.Modules;
using ModularPipelines.Options;

namespace TUnit.Pipeline.Modules;

public class InstallPlaywrightModule : Module<CommandResult>
{
protected override async Task<CommandResult?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken) =>
await context.Shell.Bash.Command(
new BashCommandOptions("npx playwright install --with-deps"),
cancellationToken);
}
6 changes: 4 additions & 2 deletions TUnit.Pipeline/Modules/RunPlaywrightTestsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

namespace TUnit.Pipeline.Modules;

[NotInParallel("NetworkTests"), RunOnLinuxOnly, RunOnWindowsOnly]
[NotInParallel("NetworkTests")]
[DependsOn<InstallPlaywrightModule>]
public class RunPlaywrightTestsModule : TestBaseModule
{
protected override Task<(DotNetRunOptions Options, CommandExecutionOptions? ExecutionOptions)> GetTestOptions(IModuleContext context, string framework, CancellationToken cancellationToken)
Expand All @@ -16,12 +17,13 @@ public class RunPlaywrightTestsModule : TestBaseModule
return Task.FromResult<(DotNetRunOptions, CommandExecutionOptions?)>((
new DotNetRunOptions
{
Project = project.FullName,
Project = project.Name,
NoBuild = true,
Configuration = "Release",
},
new CommandExecutionOptions
{
WorkingDirectory = project.Directory!.FullName,
EnvironmentVariables = new Dictionary<string, string?>
{
["DISABLE_GITHUB_REPORTER"] = "true",
Expand Down
Loading