Files
faiss/.github/workflows
Michael Norris 1cdc3709c6 Run CI on push to main to refresh ccache cache (#5291)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5291

TLDR: this runs the build on every merge of a PR. Yes it doubles the cost but it may increase cache hit rate, which is super low right now. Right now the cache is from May 5 when I first integrated it because there's no refresh on main branch. This is supposed to fix that.
--

AI description:

The `Build` workflow only triggered on `pull_request` and tag pushes,
never on pushes to `main`. GitHub Actions caches are scoped per branch:
PR runs read main's cache and write to their own throwaway PR scope.
Main's cache is therefore only refreshed when the workflow runs on
`main` itself, which never happened.

Result: PRs were restoring a month-old ccache (`2026-05-05`) on every
run, with hit rates around ~28%. Cache size sat at ~13 MB out of 2 GB.

This adds `push: branches: [main]` so the cmake build (and only the
cmake build) runs on each merge, populating main's ccache. The pip
wheel jobs are gated to non-push or tag-push events to preserve their
current behavior — they only run on PRs, manual dispatch, or tag
releases, never on plain main pushes. PyPI publish jobs are already
guarded by `startsWith(github.ref, 'refs/tags/v')`, so there is no
risk of accidental publishes.

___

Differential Revision: D107964344

fbshipit-source-id: 14d636c17b38ae476bb9e7edbe5654d21dd74f0e
2026-06-09 09:37:18 -07:00
..
2026-06-08 08:28:23 -07:00
2026-06-08 08:28:23 -07:00
2025-02-13 15:49:45 -08:00