diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index 6c9da1d08..418a46c98 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -50,7 +50,7 @@ jobs: - name: caching uses: Swatinem/rust-cache@v2 with: - prefix-key: v1-rust # Increment version for cache busting + prefix-key: v2-rust # Increment version for cache busting cache-directories: cts # We enable line numbers for panics, but that's it diff --git a/cts_runner/revision.txt b/cts_runner/revision.txt index a67a4eaa4..495758ec2 100644 --- a/cts_runner/revision.txt +++ b/cts_runner/revision.txt @@ -1 +1 @@ -ccd84d9943abc01b0421c48080280e9e940336b4 +223e1bfb039319ced939020379f7f489640a87cb diff --git a/xtask/src/cts.rs b/xtask/src/cts.rs index 62461dc2d..bbd384aa9 100644 --- a/xtask/src/cts.rs +++ b/xtask/src/cts.rs @@ -60,9 +60,14 @@ pub fn run_cts(shell: Shell, mut args: Arguments) -> anyhow::Result<()> { if git_version_at_least(&shell, [2, 49, 0])? { log::info!("Cloning CTS shallowly with revision {cts_revision}"); - cmd = cmd.args(["--depth=1", "--revision", &cts_revision]) + cmd = cmd.args(["--depth=1", "--revision", &cts_revision]); + cmd = cmd.args([ + "-c", + "remote.origin.fetch=+refs/heads/gh-pages:refs/remotes/origin/gh-pages", + ]); } else { log::info!("Cloning full checkout of CTS with revision {cts_revision}"); + cmd = cmd.args(["-b", "gh-pages", "--single-branch"]); } cmd.run().context("Failed to clone CTS")?; @@ -71,6 +76,30 @@ pub fn run_cts(shell: Shell, mut args: Arguments) -> anyhow::Result<()> { } else if !skip_checkout { shell.change_dir(CTS_CHECKOUT_PATH); + // For new clones, this is set by the cloning commands above, but older + // clones may not have it. Eventually this can be removed. + if shell + .cmd("git") + .args(["config", "get", "remote.origin.fetch"]) + .quiet() + .ignore_stdout() + .ignore_stderr() + .run() + .is_err() + { + shell + .cmd("git") + .args([ + "config", + "set", + "remote.origin.fetch", + "+refs/heads/gh-pages:refs/remotes/origin/gh-pages", + ]) + .quiet() + .run() + .context("Failed setting git config")?; + } + // If we don't have the CTS commit we want, try to fetch it. if shell .cmd("git")