Use the following optional YAML steps for debugging purposes in GitHub Actions workflows that build or run Ranorex Studio solutions.
Show Runner Execution Context
Use this step when you are not sure where the runner is executing from, or when you need to confirm that files are in the expected location.
This step is useful for:
- File not found errors
- Path mismatches
- Builds that succeed but place the output in a location that the next step does not expect.
- name: Show runner execution context
run: |
pwd
dir
dir SupportSiteDemo2\bin\DebugSearch for Version String References
Use this step when you suspect that a specific dependency version is referenced somewhere in the project.
This step is useful for:
- Version conflict errors
- Could not load assembly errors
- NuGet restoring the wrong version
- name: Search for version string references
shell: powershell
run: |
Get-ChildItem -Recurse -Include *.config,*.csproj | Select-String -Pattern '12.4.2'Replace 12.4.2 with the version number you want to search for.
Check Bin Contents
Use this step when the build reports success, but the expected executable or DLL is missing.
This step is useful when a later step fails to find the test executable.
- name: Check bin contents
shell: powershell
run: |
if (Test-Path SupportSiteDemo2\bin\Debug) {
Get-ChildItem SupportSiteDemo2\bin\Debug -Recurse
}
else {
Write-Host "The bin\Debug folder was not found."
}Delete Stale Build Artifacts
Use this step when the workflow has inconsistent build results, or when errors appear only after the second or third run.
Stale artifacts from previous builds can cause issues that are difficult to reproduce locally.
- name: Delete stale build artifacts
shell: powershell
run: |
if (Test-Path SupportSiteDemo2\obj) {
Remove-Item -Recurse -Force SupportSiteDemo2\obj
}
if (Test-Path SupportSiteDemo2\bin) {
Remove-Item -Recurse -Force SupportSiteDemo2\bin
}Clear NuGet Cache
Use this step when NuGet restores the wrong package versions, package integrity errors occur, or a package update is not picked up after you change the version number.
- name: Clear NuGet cache
run: dotnet nuget locals all --clearUnblock Files
Use this step when Windows blocks files that were downloaded from the internet, or when you get unexpected access or permission errors on DLLs or executables after checkout.
- name: Unblock files
shell: powershell
run: |
Get-ChildItem -Recurse | Unblock-FileAllow PowerShell Scripts
Use this step when the workflow returns an error that says running scripts is disabled on this system.
The following command changes the execution policy only for the current process. This means the setting applies only to the current job and does not change the machine-wide execution policy.
- name: Allow PowerShell scripts
shell: powershell
run: |
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassAfter the workflow is configured, you can add other actions and tools to support your Ranorex testing workflow.