Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions vinca/generate_gha.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ def normalize_version(version: str) -> str:
return version


# pixi clones git dependencies (e.g. vinca) into its cache, which setup-pixi saves.
# git's background auto-maintenance can leave a lock file in such a clone ("hardlink
# different from source at .../commit-graph-chain.lock"), which then breaks every
# later run restoring that cache. This step runs before Setup pixi, so it also covers
# the build script.
DISABLE_GIT_MAINTENANCE_STEP: dict[str, Any] = {
"name": "Disable git auto-maintenance",
"run": "git config --global maintenance.auto false && git config --global gc.auto 0",
}


def get_setup_pixi_step(
setup_pixi_version: str = DEFAULT_SETUP_PIXI_VERSION,
pixi_version: str = DEFAULT_PIXI_VERSION,
Expand Down Expand Up @@ -247,6 +258,7 @@ def build_unix_pipeline(
"name": "Checkout code",
"uses": "actions/checkout@v7",
},
DISABLE_GIT_MAINTENANCE_STEP,
get_setup_pixi_step(setup_pixi_version, pixi_version),
{
"name": f"Build {' '.join([pkg for pkg in batch])}",
Expand Down Expand Up @@ -371,6 +383,7 @@ def build_win_pipeline(

steps = [
{"name": "Checkout code", "uses": "actions/checkout@v7"},
DISABLE_GIT_MAINTENANCE_STEP,
get_setup_pixi_step(setup_pixi_version, pixi_version),
{
"uses": "egor-tensin/cleanup-path@v5",
Expand Down
5 changes: 4 additions & 1 deletion vinca/test_generate_gha.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def test_unix_pipeline_sets_up_pixi(tmp_path):
)

workflow = pytest.importorskip("yaml").safe_load(outfile.read_text())
setup_step = workflow["jobs"]["stage_0_job_0"]["steps"][1]
steps = workflow["jobs"]["stage_0_job_0"]["steps"]
assert steps[1]["name"] == "Disable git auto-maintenance"
assert "maintenance.auto false" in steps[1]["run"]
setup_step = steps[2]
assert setup_step == {
"name": "Setup pixi",
"uses": "prefix-dev/setup-pixi@v0",
Expand Down
Loading