forked from domaindrivendev/Swashbuckle.AspNetCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.ps1
28 lines (20 loc) · 770 Bytes
/
benchmark.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env pwsh
#Requires -PSEdition Core
#Requires -Version 7
param(
[Parameter(Mandatory = $false)][string] $Framework = "net8.0",
[Parameter(Mandatory = $false)][string] $Job = ""
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$benchmarks = (Join-Path $PSScriptRoot "perf" "Swashbuckle.AspNetCore.Benchmarks" "Swashbuckle.AspNetCore.Benchmarks.csproj")
$additionalArgs = @()
if (-Not [string]::IsNullOrEmpty($Job)) {
$additionalArgs += "--job"
$additionalArgs += $Job
}
if (-Not [string]::IsNullOrEmpty(${env:GITHUB_SHA})) {
$additionalArgs += "--exporters"
$additionalArgs += "json"
}
dotnet run --project $benchmarks --configuration "Release" --framework $Framework -- $additionalArgs --% --filter *