Skip to content

🌱 Run unit tests on Windows in CI - #5347

Draft
jessehouwing wants to merge 6 commits into
ossf:mainfrom
jessehouwing:windows-ci-unit-tests
Draft

jessehouwing wants to merge 6 commits into
ossf:mainfrom
jessehouwing:windows-ci-unit-tests

Conversation

@jessehouwing

@jessehouwing jessehouwing commented Oct 18, 2026 •

Copy link
Copy Markdown

What kind of change does this PR introduce?

CI improvement: run the unit tests on Windows as well.

What is the current behavior?

All unit tests run on ubuntu-latest only. Windows-only failures went unnoticed, including real bugs (workflow files not detected, vendor directory exclusion, localdir paths, a file handle leak); see #5344 and #5342.

What is the new behavior (if this is a feature change)?

Adds a unit-test-windows job to main.yml that runs the unit tests on windows-latest:

  • go test -race -covermode=atomic $(go list ./...) with SKIP_GINKGO=1, run under bash. make is not listed on the Windows runner image, and the unit-test Makefile target relies on POSIX shell features, so the same flags are invoked directly. Coverage upload and the e2e steps stay on the Linux job.

  • Harden Runner in audit mode, which now supports Windows runners.

  • A step before checkout sets core.autocrlf=false and core.eol=lf, so Windows checkouts keep LF (also enforced by .gitattributes in 🐛 Fix Windows path handling and file handle bugs #5342).

  • Tests for the changes have been added (for bug fixes/features)

Not applicable, this is a CI change. It was tested on a fork instead (see below).

Which issue(s) this PR fixes

Related to #5344

Special notes for your reviewer

This is stacked on #5342, whose commits are included here. It should be merged after it, otherwise the new job fails on the bugs that PR fixes. Once #5342 is merged this PR only contains the main.yml change.

Testing: the job was run on a test fork with these commits (#5342 plus this job), and unit-test (windows) succeeds on windows-latest: https://github.com/jessehouwing/test-ossf-scorecard/actions/runs/39127045819/job/117674248040

The job has not run on this repository's CI yet, so the first run here may still reveal environment-specific differences.

Does this PR introduce a user-facing change?

NONE

jessehouwing and others added 2 commits October 18, 2026 11:53
Prevents core.autocrlf checkouts from breaking byte-exact patch tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
- Close archive input files in the tarball extractors and test setups so temp dirs can be removed on Windows.
- Treat repo-relative paths as slash-separated (path vs. filepath) in IsWorkflowFile, fileIsInVendorDir and the localdir client.
- Close files read in tests before cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
@jessehouwing
jessehouwing force-pushed the windows-ci-unit-tests branch from 891984e to 92a1154 Compare October 18, 2026 11:39
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
@jessehouwing
jessehouwing force-pushed the windows-ci-unit-tests branch from ca47948 to 6f5c5e3 Compare October 18, 2026 12:22
jessehouwing and others added 2 commits October 18, 2026 14:22
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant