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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For legacy DDKBuild projects:
```yaml
- name: build driver
shell: cmd
run: call "${{ steps.wdk7.outputs.ddkbuild-cmd }}" -WIN7A64 free src
run: call ddkbuild.cmd -WIN7A64 free src
```

Use `root` to point at a preinstalled WDK7 tree, or `download-url` to provide
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29172,6 +29172,7 @@ function publishWdk7(root, source, cacheHit, sdk) {
exportVariable("WDK7_DDKBUILD_CMD", ddkbuildCmd());
exportVariable("WDK7_CMAKE_GENERATOR", cmakeGenerator);
addPath(host);
addPath(actionRoot());
setOutput("found", "true");
setOutput("root", resolvedRoot);
setOutput("source", source);
Expand Down
25 changes: 23 additions & 2 deletions scripts/test-e2e.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ function Assert-ExistingPath {
}
}

<#
.SYNOPSIS
Ensures a command is available through PATH before the e2e script uses it.

.DESCRIPTION
The action adds bundled helper commands to PATH for downstream steps. Checking
command resolution directly protects the user-facing contract that legacy
projects can call ddkbuild.cmd without referencing an action output.
#>
function Assert-CommandAvailable {
param(
[string]$CommandName
)

# Get-Command tests the same PATH-based resolution that a later cmd.exe call
# relies on when it invokes the bundled batch wrapper.
if ($null -eq (Get-Command $CommandName -ErrorAction SilentlyContinue)) {
throw "$CommandName is not available on PATH."
}
}

<#
.SYNOPSIS
Runs a command and exits with the command's status when it fails.
Expand Down Expand Up @@ -198,7 +219,7 @@ function Build-DdkbuildTarget {
# expects normal cmd call semantics. The source path stays relative
# because legacy ddkbuild path handling is more reliable with repo-local
# target directories than with absolute workflow paths.
Invoke-Checked "cmd" @("/s", "/c", "call ""$env:WDK7_DDKBUILD_CMD"" $target free ""$source""")
Invoke-Checked "cmd" @("/s", "/c", "call ddkbuild.cmd $target free ""$source""")
}

$sysFiles = @(Get-ChildItem -Path $sourcePath -Recurse -Filter e2e_ddkbuild.sys)
Expand All @@ -214,7 +235,7 @@ function Build-DdkbuildTarget {

Assert-ExistingPath $env:WDK7_ROOT "WDK7_ROOT is not set or does not exist."
Assert-ExistingPath $env:WDK7_CMAKE_TOOLCHAIN_FILE "WDK7_CMAKE_TOOLCHAIN_FILE is not set or does not exist."
Assert-ExistingPath $env:WDK7_DDKBUILD_CMD "WDK7_DDKBUILD_CMD is not set or does not exist."
Assert-CommandAvailable "ddkbuild.cmd"

if ([string]::IsNullOrWhiteSpace($env:WDK7_CMAKE_GENERATOR)) {
throw "WDK7_CMAKE_GENERATOR is not set."
Expand Down
4 changes: 4 additions & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ export function publishWdk7(root: string, source: string, cacheHit: boolean, sdk
// invoke NMake and rc.exe after the action step completes.
core.addPath(host);

// The action root is added so legacy projects can run ddkbuild.cmd directly
// without reaching through a step output for the bundled wrapper path.
core.addPath(actionRoot());

core.setOutput("found", "true");
core.setOutput("root", resolvedRoot);
core.setOutput("source", source);
Expand Down
Loading