[PR #9348] [MERGED] .github: always run tests, and other helpful fixes #12922

Closed
opened 2026-04-13 00:12:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9348
Author: @bmizerany
Created: 2/25/2025
Status: Merged
Merged: 2/25/2025
Merged by: @bmizerany

Base: mainHead: bmizerany/makecihelpfulagain


📝 Commits (1)

  • eab66c6 .github: always run tests, and other helpful fixes

📊 Changes

3 files changed (+79 additions, -5 deletions)

View changed files

📝 .github/workflows/test.yaml (+77 -3)
📝 ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-embed.metal (+1 -1)
📝 ml/backend/ggml/ggml/src/ggml-metal/metal.go (+1 -1)

📄 Description

During work on our new registry client, I ran into frustrations with CI
where a misspelling in a comment caused the linter to fail, which caused
the tests to not run, which caused the build to not be cached, which
caused the next run to be slow, which caused me to be sad.

This commit address these issues, and pulls in some helpful changes
we've had in CI on ollama.com for some time now.

They are:

  • Always run tests, even if the other checks fail.

Tests are the most important part of CI, and should always run. Failures
in tests can be correlated with failures in other checks, and can help
surface the root cause of the failure sooner. This is especially
important when the failure is platform specific, and the tests are not
platform independent.

  • Check that go generate is clean.

This prevents 'go generate' abuse regressions. This codebase used to use
it to generate platform specific binary build artifacts. Let's make sure
that does not happen again and this powerful tool is used correctly, and
the generated code is checked in.

Also, while adding go generate the check, it was revealed that the
generated metal code was putting dates in the comments, resulting in
non-deterministic builds. This is a bad practice, and this commit fixes
that. Git tells us the most important date: the commit date along with
other associated changes.

  • Check that go mod tidy is clean.

A new job to check that go mod tidy is clean was added, to prevent
easily preventable merge conflicts or go.mod changes being deferred to a
future PR that is unrelated to the change that caused the go.mod to
change.

  • More robust caching.

We now cache the go build cache, and the go mod download cache
independently. This is because the download cache contains zips that can
be unpacked in parallel faster than they can be fetched and extracted by
tar. This speeds up the build significantly.

The linter is hostile enough. It does not need to also punish us with
longer build times due to small failures like misspellings.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9348 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 2/25/2025 **Status:** ✅ Merged **Merged:** 2/25/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/makecihelpfulagain` --- ### 📝 Commits (1) - [`eab66c6`](https://github.com/ollama/ollama/commit/eab66c6fe7461479c6c61160274186ec2e30c24a) .github: always run tests, and other helpful fixes ### 📊 Changes **3 files changed** (+79 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yaml` (+77 -3) 📝 `ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-embed.metal` (+1 -1) 📝 `ml/backend/ggml/ggml/src/ggml-metal/metal.go` (+1 -1) </details> ### 📄 Description During work on our new registry client, I ran into frustrations with CI where a misspelling in a comment caused the linter to fail, which caused the tests to not run, which caused the build to not be cached, which caused the next run to be slow, which caused me to be sad. This commit address these issues, and pulls in some helpful changes we've had in CI on ollama.com for some time now. They are: * Always run tests, even if the other checks fail. Tests are the most important part of CI, and should always run. Failures in tests can be correlated with failures in other checks, and can help surface the root cause of the failure sooner. This is especially important when the failure is platform specific, and the tests are not platform independent. * Check that `go generate` is clean. This prevents 'go generate' abuse regressions. This codebase used to use it to generate platform specific binary build artifacts. Let's make sure that does not happen again and this powerful tool is used correctly, and the generated code is checked in. Also, while adding `go generate` the check, it was revealed that the generated metal code was putting dates in the comments, resulting in non-deterministic builds. This is a bad practice, and this commit fixes that. Git tells us the most important date: the commit date along with other associated changes. * Check that `go mod tidy` is clean. A new job to check that `go mod tidy` is clean was added, to prevent easily preventable merge conflicts or go.mod changes being deferred to a future PR that is unrelated to the change that caused the go.mod to change. * More robust caching. We now cache the go build cache, and the go mod download cache independently. This is because the download cache contains zips that can be unpacked in parallel faster than they can be fetched and extracted by tar. This speeds up the build significantly. The linter is hostile enough. It does not need to also punish us with longer build times due to small failures like misspellings. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:12:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12922