Skip to content
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
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 Task<CommandResult?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken) =>
context.Shell.Bash.Command(

Check warning on line 11 in TUnit.Pipeline/Modules/InstallPlaywrightModule.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (macos-latest)

Nullability of reference types in value of type 'Task<CommandResult>' doesn't match target type 'Task<CommandResult?>'.

Check warning on line 11 in TUnit.Pipeline/Modules/InstallPlaywrightModule.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (ubuntu-latest)

Nullability of reference types in value of type 'Task<CommandResult>' doesn't match target type 'Task<CommandResult?>'.

Check warning on line 11 in TUnit.Pipeline/Modules/InstallPlaywrightModule.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (windows-latest)

Nullability of reference types in value of type 'Task<CommandResult>' doesn't match target type 'Task<CommandResult?>'.
new BashCommandOptions("npx playwright install --with-deps"),
cancellationToken);
}
3 changes: 2 additions & 1 deletion 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 Down
Loading