Skip to content

Verify published binaries run before archiving in CI#398

Merged
geofflamrock merged 4 commits intomainfrom
copilot/add-ci-step-to-run-binary
Feb 14, 2026
Merged

Verify published binaries run before archiving in CI#398
geofflamrock merged 4 commits intomainfrom
copilot/add-ci-step-to-run-binary

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Add binary verification step to CI workflow

Understanding the issue:

  • The CI workflow builds binaries for 6 OS/arch combinations (Linux amd64/arm64, Windows amd64/arm64, macOS amd64/arm64)
  • After dotnet publish, binaries should be tested to ensure they run
  • The application already supports --version option
  • Need to add a verification step after publish but before archiving

Plan

  • Explore CI workflow structure
  • Verify --version option exists
  • Add verification step to workflow after publish
  • Handle OS-specific binary paths (stack vs stack.exe)
  • Test the changes locally
  • Refactor to use matrix executable property (per feedback)
  • Fix Windows ARM64 runner to use windows-11-arm
  • Commit changes

Changes Made

  1. Added executable property to each matrix entry (stack for Linux/macOS, stack.exe for Windows)
  2. Added single "Test binary" step that:
    • Uses chmod +x with || true to make binary executable (no-op on Windows)
    • Executes ${{ matrix.executable }} --version using the matrix property
  3. Changed Windows ARM64 runner from windows-latest to windows-11-arm to fix x64/ARM64 architecture mismatch

This approach is cleaner and more maintainable than OS-specific conditional steps.

Original prompt

This application is built for a variety of operating systems and architectures. As part of the CI workflow the binary for the relevant os+arch is built using dotnet publish and then uploaded as an artifact.

I want to make sure that the binary will actually run properly after it is built.

Add a step to the relevant part of the CI workflow during publish to run the built binary. The application has a --version (e.g. stack --version) option that can be run to check the version of the application, this should be sufficient to assert that the built binary can be run successfully.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CI step to verify built binary execution Verify published binaries run before archiving in CI Feb 13, 2026
Copilot AI requested a review from geofflamrock February 13, 2026 23:18
- name: Publish
run: dotnet publish src/Stack/Stack.csproj -c Release -r ${{ matrix.runtime-id }} -p:Version=${{ needs.version.outputs.version }} -p:DebugType=None -p:DebugSymbols=false -o ${{ github.workspace }}/publish

- name: Test binary (Windows)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Instead of detecting the os and running separate steps for Linux vs Windows, add the exe name to the matrix values above and use that with a single verification step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Added executable property to the matrix (stack/stack.exe) and replaced the two conditional steps with a single step that uses ${{ matrix.executable }}. The chmod +x command includes || true so it won't fail on Windows. (bd2ab0d)

Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
runtime-id: win-arm64
artifact-name: windows_arm64
archive_type: zip
os: windows-latest
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the windows arm64 ci build is failing because it's running on windows-latest which is x64. Is there another runner image that can be used for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to windows-11-arm which is the GitHub Actions runner image for Windows ARM64. This will run the build on native ARM64 hardware instead of x64. (33403a8)

Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
Copilot AI requested a review from geofflamrock February 14, 2026 00:41
@geofflamrock geofflamrock marked this pull request as ready for review February 14, 2026 01:27
@geofflamrock geofflamrock merged commit 6387aca into main Feb 14, 2026
15 checks passed
@geofflamrock geofflamrock deleted the copilot/add-ci-step-to-run-binary branch February 14, 2026 01:28
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.

2 participants