Run .NET tests with preview native libs
Testing & QualityRun .NET tests with preview native libs is an Agent Skill for testing & quality published in the sandrohanea/whisper.net repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use when validating managed .NET changes that do not modify whisper.cpp or native runtime build outputs.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/sandrohanea/whisper.net/blob/HEAD/.github/skills/run-dotnet-tests-with-preview-nativelibs/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/run-net-tests-with-preview-native-libs, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Run .NET tests with preview native libs
Use this skill when you need to run Whisper.net managed tests and the change does not require rebuilding native runtimes or changing the whisper.cpp submodule.
When to use this
- The task changes managed C# code, tests, docs, samples, or project files only.
- You need native libraries available locally for
dotnet test. - You do not need to validate a new
whisper.cpprevision or native build-system change.
Do not use this shortcut for changes under whisper.cpp, native build scripts, runtime package targets, or native binary outputs. In those cases, build the relevant native runtimes instead.
How the preview package is produced
The .github/workflows/upload-build-artifacts.yml workflow:
- Reads the pinned
whisper.cppshort commit SHA. - Creates a prerelease tag named
preview-nativelibs-<sha>. - Uploads one release asset named
native-runtimes.zip. - Stores the merged native build outputs inside the archive under
runtime-artifacts/.
Example release:
https://github.com/sandrohanea/whisper.net/releases/tag/preview-nativelibs-f24588a
PowerShell workflow
Run from the repository root:
$commit = git rev-parse --short=7 HEAD:whisper.cpp
$tag = "preview-nativelibs-$commit"
gh release download $tag --repo sandrohanea/whisper.net --pattern native-runtimes.zip --clobber
Expand-Archive .\native-runtimes.zip -DestinationPath . -Force
Copy-Item .\runtime-artifacts\* .\runtimes\ -Recurse -Force
Remove-Item .\runtime-artifacts -Recurse -Force
Remove-Item .\native-runtimes.zip
dotnet restore .\Whisper.net.slnx
dotnet build .\Whisper.net.slnx --no-restore -warnaserror
dotnet test .\Whisper.net.slnx --no-build --logger "trx"
Bash workflow
Run from the repository root:
commit="$(git rev-parse --short=7 HEAD:whisper.cpp)"
tag="preview-nativelibs-$commit"
gh release download "$tag" --repo sandrohanea/whisper.net --pattern native-runtimes.zip --clobber
unzip -o native-runtimes.zip
cp -R runtime-artifacts/* runtimes/
rm -rf runtime-artifacts native-runtimes.zip
dotnet restore ./Whisper.net.slnx
dotnet build ./Whisper.net.slnx --no-restore -warnaserror
dotnet test ./Whisper.net.slnx --no-build --logger "trx"
Test model handling
The preview native libs release contains native runtime artifacts, not necessarily test model files. Do not set WHISPER_TEST_MODEL_PATH to runtimes/ unless the required ggml-*.bin model files are present there. Without that variable, the tests download models through the normal test fixture path.
Repository hygiene
- Treat downloaded native runtimes as local test inputs, not source changes.
- Do not commit copied binaries from
native-runtimes.zipunless the task explicitly asks to update runtime artifacts. - Remove temporary
native-runtimes.zipandruntime-artifacts/files after unpacking.