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
50 changes: 50 additions & 0 deletions .github/workflows/ci-powershell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: CI-PowerShell (called)
permissions: {}

on:
workflow_call:

jobs:
test:
name: Pester
permissions:
contents: read
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Run Pester tests
id: test
shell: powershell
run: |
New-Item -ItemType Directory -Path ./build/reports -Force | Out-Null

Import-Module Pester -RequiredVersion 5.9.0 -Force
$config = New-PesterConfiguration
$config.Run.Path = "./tests/scripts"
$config.Run.Exit = $true
$config.Output.Verbosity = "Detailed"
$config.TestResult.Enabled = $true
$config.TestResult.OutputFormat = "JUnitXml"
$config.TestResult.OutputPath = "./build/reports/junit.xml"
$config.CodeCoverage.Enabled = $true
$config.CodeCoverage.Path = @(
Get-ChildItem -Path "./scripts/windows/*.ps1" |
Select-Object -ExpandProperty FullName
)
$config.CodeCoverage.OutputFormat = "Cobertura"
$config.CodeCoverage.OutputPath = "./build/reports/coverage.xml"

Invoke-Pester -Configuration $config

- name: Upload report artifact
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: reports-PowerShell
path: build/reports
if-no-files-found: error
3 changes: 3 additions & 0 deletions .github/workflows/ci-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- build_name: Windows-MSVC
flag: Windows-MSVC
has_coverage: true
- build_name: PowerShell
flag: PowerShell
has_coverage: true
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,22 @@ jobs:
release_commit: ${{ needs.setup_release.outputs.release_commit }}
release_version: ${{ needs.setup_release.outputs.release_version }}

powershell:
name: PowerShell
permissions:
contents: read
uses: ./.github/workflows/ci-powershell.yml

results:
name: Coverage and Test Results
if: >-
always() &&
(needs.build.result == 'success' || needs.build.result == 'failure') &&
(needs.powershell.result == 'success' || needs.powershell.result == 'failure') &&
startsWith(github.repository, 'LizardByte/')
needs: build
needs:
- build
- powershell
permissions:
contents: read
uses: ./.github/workflows/ci-results.yml
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/install-driver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ function Install-RootDeviceWithSetupApi {
Invoke-CheckedCommand -FilePath $SetupHelperPath -Arguments @("install", $Path, $TargetHardwareId)
}

if ($MyInvocation.InvocationName -eq ".") {
return
}

Start-LibVirtualHidTranscript -Path $LogPath

try {
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/sign-driver-package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function Invoke-CheckedCommand {
}
}

if ($MyInvocation.InvocationName -eq ".") {
return
}

$resolvedPackagePath = (Resolve-Path -LiteralPath $PackagePath).Path
$catalogPath = Join-Path $resolvedPackagePath $CatalogName
if (-not (Test-Path -LiteralPath $catalogPath)) {
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/test-browser-gamepad.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ function Get-GamepadApiProbeExpression {
"@
}

if ($MyInvocation.InvocationName -eq ".") {
return
}

if ($HoldSeconds -le $TimeoutSeconds) {
throw "-HoldSeconds must be greater than -TimeoutSeconds so the adapter remains alive for browser polling."
}
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/test-installed-driver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ function Invoke-GamepadAdapterSmoke {
}
}

if ($MyInvocation.InvocationName -eq ".") {
return
}

Assert-RootDeviceStarted -TargetHardwareId $HardwareId
Assert-ControlDeviceOpen -Path $ControlDevicePath
Invoke-GamepadAdapterSmoke `
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/uninstall-driver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ function Remove-DriverCertificate {
}
}

if ($MyInvocation.InvocationName -eq ".") {
return
}

Start-LibVirtualHidTranscript -Path $LogPath

try {
Expand Down
Loading
Loading