Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b9172cd
Refactor Windows driver installation and VHF setup
ReenigneArcher Jul 1, 2026
5bf9849
Fix UMDF HID report ID handling
ReenigneArcher Jul 1, 2026
6ff7069
Use 8-bit axes in HID gamepad profiles
ReenigneArcher Jul 1, 2026
6b0b53a
Fix HID descriptor axes and negate Y-axis values
ReenigneArcher Jul 1, 2026
572a0a2
Align gamepad HID identity and report shape
ReenigneArcher Jul 1, 2026
4445dfb
Redesign Windows driver to use HIDClass
ReenigneArcher Jul 2, 2026
c4b3500
Configure UMDF driver for VHF source mode
ReenigneArcher Jul 2, 2026
f4b7ede
Refactor gamepad HID descriptor and add PnP device discovery
ReenigneArcher Jul 2, 2026
799b7ef
Harden UMDF config and improve tracing
ReenigneArcher Jul 2, 2026
60043c1
Use per-gamepad VHF targets
ReenigneArcher Jul 2, 2026
3bd8ac3
Implement XboxGIP profiles with unnumbered reports
ReenigneArcher Jul 2, 2026
e3148f4
Add Windows driver smoke test
ReenigneArcher Jul 2, 2026
a2a4c2d
Fix Xbox GIP report encoding for XInput
ReenigneArcher Jul 2, 2026
7c3131f
Add browser Gamepad API CI validation
ReenigneArcher Jul 2, 2026
00e9cfa
Submit neutral gamepad report on create
ReenigneArcher Jul 2, 2026
e92b1a8
Align Windows gamepad profiles and reports
ReenigneArcher Jul 2, 2026
2b35a10
Align Xbox IDs and add Switch Pro HID reports
ReenigneArcher Jul 2, 2026
221ab80
Switch Xbox Series PID to 0x0B12, add GIP match ID
ReenigneArcher Jul 2, 2026
28e0920
Update DualShock 4 profile to v1 identity
ReenigneArcher Jul 3, 2026
6aedab4
Refactor Windows CI driver install and test scripts
ReenigneArcher Jul 3, 2026
62f2ccd
Simplify Windows driver smoke test checks
ReenigneArcher Jul 3, 2026
0a54fe2
Fix Sonar issues in Windows driver PR
ReenigneArcher Jul 3, 2026
deb76c2
Resolve remaining Sonar report packing issues
ReenigneArcher Jul 3, 2026
4ff8a63
Refactor driver scripts and button bit packing
ReenigneArcher Jul 3, 2026
41afe8c
Refactor button maps into constexpr helpers
ReenigneArcher Jul 3, 2026
ce8d833
Parameterize CI build configs
ReenigneArcher Jul 3, 2026
ea6d29c
Fix yamllint errors
ReenigneArcher Jul 3, 2026
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
193 changes: 103 additions & 90 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_BUILD_CONFIG: Debug
DRIVER_BUILD_CONFIG: Release
OPENCPPCOVERAGE_VERSION: '0.9.9.0'
PYTHON_VERSION: '3.14'

Expand Down Expand Up @@ -42,7 +44,9 @@ jobs:

build:
name: Build (${{ matrix.name }})
needs: setup_release
needs:
- setup_release
- windows_driver
permissions:
contents: read
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -206,7 +210,7 @@ jobs:
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_CONFIG} \
-B cmake-build-ci \
-G Ninja \
-S .
Expand All @@ -228,72 +232,54 @@ jobs:
-S .

- name: Build
if: matrix.kind != 'msvc'
run: cmake --build cmake-build-ci -- -j2
run: cmake --build cmake-build-ci --config ${{ env.CMAKE_BUILD_CONFIG }} --parallel 2

- name: Build MSVC
if: matrix.kind == 'msvc'
run: cmake --build cmake-build-ci --config Debug --parallel 2

- name: Configure Windows test driver package
if: >-
matrix.kind == 'msvc' &&
github.event_name == 'pull_request'
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.setup_release.outputs.release_version }}
COMMIT: ${{ needs.setup_release.outputs.release_commit }}
run: |
$certificatePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver-test\certificates\libvirtualhid-ci-test.cer"
cmake `
-DBUILD_DOCS=OFF `
-DBUILD_EXAMPLES=OFF `
-DBUILD_TESTS=OFF `
-DLIBVIRTUALHID_BUILD_WINDOWS_DRIVER=ON `
-DLIBVIRTUALHID_ENABLE_PACKAGING=OFF `
"-DLIBVIRTUALHID_DRIVER_TEST_CERTIFICATE=$certificatePath" `
-A x64 `
-B cmake-build-driver-test `
-G "Visual Studio 17 2022" `
-S .

- name: Build Windows test driver package
if: >-
matrix.kind == 'msvc' &&
github.event_name == 'pull_request'
run: cmake --build cmake-build-driver-test --config Release --target libvirtualhid_windows_catalog --parallel 2
- name: Download Windows driver installer artifact
if: runner.os == 'Windows'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-driver-installer
path: windows-driver-installer

- name: Sign Windows test driver package
if: >-
matrix.kind == 'msvc' &&
github.event_name == 'pull_request'
- name: Install Windows driver installer
if: runner.os == 'Windows'
shell: pwsh
run: |
$packagePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver-test\src\platform\windows\driver\package\Release"
$certificatePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver-test\certificates\libvirtualhid-ci-test.cer"
.\scripts\windows\sign-driver-package.ps1 `
-PackagePath $packagePath `
-CertificatePath $certificatePath
$installer = Get-ChildItem -LiteralPath .\windows-driver-installer -Filter *.msi | Select-Object -First 1
if (!$installer) {
throw "Windows driver installer artifact did not contain an MSI."
}
$logPath = Join-Path $env:RUNNER_TEMP "libvirtualhid-driver-install.log"
$process = Start-Process `
-FilePath msiexec.exe `
-ArgumentList @("/i", $installer.FullName, "/qn", "/norestart", "/L*v", $logPath) `
-Wait `
-PassThru `
-NoNewWindow
if ($process.ExitCode -notin @(0, 3010)) {
Get-Content -LiteralPath $logPath -ErrorAction SilentlyContinue
throw "Windows driver installer exited with code $($process.ExitCode)."
}

- name: Install Windows test driver package
if: >-
matrix.kind == 'msvc' &&
github.event_name == 'pull_request'
- name: Verify Windows test driver package
if: runner.os == 'Windows'
shell: pwsh
run: |
$packagePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver-test\src\platform\windows\driver\package\Release"
$certificatePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver-test\certificates\libvirtualhid-ci-test.cer"
.\scripts\windows\install-driver.ps1 `
-InfPath (Join-Path $packagePath "libvirtualhid.inf") `
-CertificatePath $certificatePath
if ("${{ matrix.kind }}" -eq "msys2") {
$env:PATH = "C:\msys64\${{ matrix.msystem }}\bin;C:\msys64\usr\bin;$env:PATH"
$gamepadAdapterPath = "$env:GITHUB_WORKSPACE\cmake-build-ci\examples\gamepad_adapter.exe"
} else {
$gamepadAdapterPath = Join-Path `
"$env:GITHUB_WORKSPACE\cmake-build-ci\examples\$env:CMAKE_BUILD_CONFIG" `
"gamepad_adapter.exe"
}
$profiles = @("generic", "xone", "xseries", "ds4", "ds5", "switch")
foreach ($profile in $profiles) {
.\scripts\windows\test-installed-driver.ps1 `
-GamepadAdapterPath $gamepadAdapterPath `
-Profile $profile `
-Verbose
}

- name: Prepare report directory
run: cmake -E make_directory cmake-build-ci/reports
Expand Down Expand Up @@ -325,7 +311,7 @@ jobs:
"--export_type=cobertura:$env:GITHUB_WORKSPACE\cmake-build-ci\reports\coverage.xml" `
--working_dir "$env:GITHUB_WORKSPACE\cmake-build-ci\tests" `
-- `
"$env:GITHUB_WORKSPACE\cmake-build-ci\tests\Debug\test_libvirtualhid.exe" `
"$env:GITHUB_WORKSPACE\cmake-build-ci\tests\$env:CMAKE_BUILD_CONFIG\test_libvirtualhid.exe" `
--gtest_color=yes `
"--gtest_output=xml:$env:GITHUB_WORKSPACE\cmake-build-ci\reports\junit.xml"

Expand Down Expand Up @@ -378,36 +364,47 @@ jobs:
-o reports/coverage.xml

- name: Run gamepad adapter example
if: matrix.kind != 'msvc'
if: runner.os == 'Linux'
run: |
if [[ "${RUNNER_OS}" == "Windows" ]]; then
./cmake-build-ci/examples/gamepad_adapter.exe
else
./cmake-build-ci/examples/gamepad_adapter
fi
./cmake-build-ci/examples/gamepad_adapter

- name: Run gamepad adapter example MSVC
if: matrix.kind == 'msvc'
run: .\cmake-build-ci\examples\Debug\gamepad_adapter.exe
- name: Run gamepad adapter example Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
if ("${{ matrix.kind }}" -eq "msys2") {
$env:PATH = "C:\msys64\${{ matrix.msystem }}\bin;C:\msys64\usr\bin;$env:PATH"
& .\cmake-build-ci\examples\gamepad_adapter.exe
} else {
& ".\cmake-build-ci\examples\$env:CMAKE_BUILD_CONFIG\gamepad_adapter.exe"
}

- name: Uninstall Windows test driver package
- name: Uninstall Windows driver installer
if: >-
always() &&
matrix.kind == 'msvc' &&
github.event_name == 'pull_request'
runner.os == 'Windows'
shell: pwsh
run: |
.\scripts\windows\uninstall-driver.ps1 `
-OriginalName "libvirtualhid.inf" `
-RemoveCertificateSubject "CN=libvirtualhid CI Test Driver Signing" `
-Force
$installer = Get-ChildItem -LiteralPath .\windows-driver-installer `
-Filter *.msi `
-ErrorAction SilentlyContinue |
Select-Object -First 1
if ($installer) {
$logPath = Join-Path $env:RUNNER_TEMP "libvirtualhid-driver-uninstall.log"
$process = Start-Process `
-FilePath msiexec.exe `
-ArgumentList @("/x", $installer.FullName, "/qn", "/norestart", "/L*v", $logPath) `
-Wait `
-PassThru `
-NoNewWindow
if ($process.ExitCode -notin @(0, 3010)) {
Get-Content -LiteralPath $logPath -ErrorAction SilentlyContinue
throw "Windows driver installer uninstall exited with code $($process.ExitCode)."
}
}

- name: Install
if: matrix.kind != 'msvc'
run: cmake --install cmake-build-ci --prefix cmake-build-ci/install

- name: Install MSVC
if: matrix.kind == 'msvc'
run: cmake --install cmake-build-ci --config Debug --prefix cmake-build-ci/install
run: cmake --install cmake-build-ci --config ${{ env.CMAKE_BUILD_CONFIG }} --prefix cmake-build-ci/install

- name: Upload install artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down Expand Up @@ -469,7 +466,11 @@ jobs:

- name: Build Windows driver package
shell: pwsh
run: cmake --build cmake-build-driver --config Release --target libvirtualhid_windows_catalog --parallel 2
run: >-
cmake --build cmake-build-driver
--config ${{ env.DRIVER_BUILD_CONFIG }}
--target libvirtualhid_windows_catalog
--parallel 2

- name: Validate Azure signing configuration
if: >-
Expand All @@ -484,14 +485,26 @@ jobs:
run: |
$packagePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver\src\platform\windows\driver\package\Release"
"cmake-build-driver\src\platform\windows\driver\package\$env:DRIVER_BUILD_CONFIG"
$certificatePath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver\certificates\libvirtualhid-ci-test.cer"
.\scripts\windows\sign-driver-package.ps1 `
-PackagePath $packagePath `
-CertificatePath $certificatePath

- name: Locate Windows driver catalog
id: driver_catalog
if: >-
github.event_name == 'push' &&
vars.AZURE_SIGNING_ACCOUNT != ''
shell: pwsh
run: |
$catalogPath = Join-Path `
$env:GITHUB_WORKSPACE `
"cmake-build-driver\src\platform\windows\driver\package\$env:DRIVER_BUILD_CONFIG\libvirtualhid.cat"
"path=$catalogPath" >> $env:GITHUB_OUTPUT

- name: Sign Windows driver package with Azure Trusted Signing
if: >-
github.event_name == 'push' &&
Expand All @@ -504,14 +517,14 @@ jobs:
certificate-profile-name: ${{ vars.AZURE_SIGNING_CERT_PROFILE }}
endpoint: ${{ vars.AZURE_SIGNING_ENDPOINT }}
files: |
${{ github.workspace }}/cmake-build-driver/src/platform/windows/driver/package/Release/libvirtualhid.cat
${{ steps.driver_catalog.outputs.path }}
signing-account-name: ${{ vars.AZURE_SIGNING_ACCOUNT }}

- name: Package Windows driver installer
shell: pwsh
run: |
Push-Location .\cmake-build-driver
cpack -G WIX
cpack -G WIX -C $env:DRIVER_BUILD_CONFIG
$packageExitCode = $LASTEXITCODE
Pop-Location
if ($packageExitCode -ne 0) {
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Project configuration
#
cmake_minimum_required(VERSION 3.24)
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
project(libvirtualhid VERSION 0.0.0
DESCRIPTION "Cross-platform virtual HID device library."
HOMEPAGE_URL "https://app.lizardbyte.dev"
Expand Down
Loading
Loading