Skip to content

Add a PR, CI workflow that performs a basic install of NuGet packages#24

Merged
mschofie merged 5 commits intodevelopfrom
mschofie/scenario-tests
Mar 6, 2026
Merged

Add a PR, CI workflow that performs a basic install of NuGet packages#24
mschofie merged 5 commits intodevelopfrom
mschofie/scenario-tests

Conversation

@mschofie
Copy link
Owner

@mschofie mschofie commented Mar 6, 2026

Fixes #20.

Adds an end-to-end scenario test for :/CMakeLists.txt and a GitHub Actions workflow that runs it on Windows, Linux, and macOS.

What's included

  • Some pre-cursor fixes:

    • Accommodate 'NuNuGet'/'NuNuGet.exe' naming across platforms
    • ensure_nunuget should make NuNuGet executable on non-WIN32 platforms - Since the NuGet is unpacked as a .zip file, the NuNuGet executable isn't marked as executable. Using file(CHMOD to mark it
    • NUGET_LOCATION should use the lower-case PACKAGE_NAME - The NuGet packages in the global packages folder have a lower-case folder name. Since Linux and MacOS respect the casing, ensure_nunuget needs to be more strict here.
  • :/scenarios/basic/ - a self-contained CMake project that exercises :/CMakeLists.txt end-to-end with three packages (Microsoft.Windows.ImplementationLibrary with a floating version, Microsoft.Windows.CppWinRT, Microsoft.Windows.SDK.CPP). After configuration it asserts:

    • NuNuGet was downloaded and the executable exists
    • NUGET_VERSION-* and NUGET_LOCATION-* global properties are set, and the package paths exist on disk
    • Microsoft.Windows.ImplementationLibrary's floating version 1.* resolved to a 1.x release
    • The policy-appropriate find_package hint variable is set (*_ROOT or *_DIR)
    • find_package(Microsoft.Windows.ImplementationLibrary) creates the expected target with valid include directories
  • scenarios/basic/Basic.Tests.ps1 - Pester tests that encapsulate the two-step configure logic:

    • Step 1: deletes any existing lock file, runs cmake configure, asserts exit 0 and that packages.lock.json was created
    • Step 2: runs cmake configure again with the existing lock file, asserts exit 0 (verifies lock file consistency)
  • .github/workflows/scenario-tests.yml - runs the Pester tests on windows-latest, ubuntu-latest, and macos-latest on every push to main and on pull requests. Uses fail-fast: false so all three platforms always run to completion.

  • .gitignore — ignores __* build/tool artifact directories.

@mschofie mschofie force-pushed the mschofie/scenario-tests branch 2 times, most recently from 0003102 to ba56162 Compare March 6, 2026 20:48
@mschofie mschofie force-pushed the mschofie/scenario-tests branch from ba56162 to 6cfb5bf Compare March 6, 2026 21:08
@mschofie mschofie merged commit 00946b4 into develop Mar 6, 2026
3 checks passed
@mschofie mschofie deleted the mschofie/scenario-tests branch March 6, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a basic CI pipeline

1 participant